Exemple #1
0
 public bool Equals(ConfigRemote other)
 {
     return
         (String.Equals(name, other.name) &&
          String.Equals(url, other.url)
         );
 }
Exemple #2
0
        public void UpdateData(IRepositoryInfoCacheData data)
        {
            var now       = DateTimeOffset.Now;
            var isUpdated = false;

            if (!Nullable.Equals(currentGitRemote, data.CurrentGitRemote))
            {
                currentGitRemote = data.CurrentGitRemote ?? GitRemote.Default;
                isUpdated        = true;
            }

            if (!Nullable.Equals(currentGitBranch, data.CurrentGitBranch))
            {
                currentGitBranch = data.CurrentGitBranch ?? GitBranch.Default;
                isUpdated        = true;
            }

            if (!Nullable.Equals(currentConfigRemote, data.CurrentConfigRemote))
            {
                currentConfigRemote = data.CurrentConfigRemote ?? ConfigRemote.Default;
                isUpdated           = true;
            }

            if (!Nullable.Equals(currentConfigBranch, data.CurrentConfigBranch))
            {
                currentConfigBranch = data.CurrentConfigBranch ?? ConfigBranch.Default;
                isUpdated           = true;
            }

            SaveData(now, isUpdated);
        }
Exemple #3
0
 private static GitRemote GetGitRemote(ConfigRemote configRemote) => new GitRemote(configRemote.Name, configRemote.Url);
Exemple #4
0
 private static GitRemote GetGitRemote(ConfigRemote configRemote)
 {
     return(new GitRemote(configRemote.Name, configRemote.Url));
 }
Exemple #5
0
 private GitRemote GetGitRemote(ConfigRemote configRemote)
 {
     return(new GitRemote {
         Name = configRemote.Name, Url = configRemote.Url
     });
 }
Exemple #6
0
 public ConfigBranch(string name, ConfigRemote?remote, string trackingBranch)
 {
     this.name           = name;
     this.remote         = remote ?? ConfigRemote.Default;
     this.trackingBranch = trackingBranch != null && trackingBranch.StartsWith("refs/heads") ? trackingBranch.Substring("refs/heads".Length + 1) : null;
 }
Exemple #7
0
 public ConfigBranch(string name)
 {
     this.name           = name;
     this.trackingBranch = null;
     remote = ConfigRemote.Default;
 }
Exemple #8
0
 public ConfigBranch(string name, ConfigRemote?remote)
 {
     this.name   = name;
     this.remote = remote ?? ConfigRemote.Default;
 }
Exemple #9
0
 public ConfigBranch(string name)
 {
     this.name = name;
     remote    = ConfigRemote.Default;
 }