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

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

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

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

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

            if (forcedInvalidation || !String.Equals(currentHead, data.CurrentHead))
            {
                currentHead = data.CurrentHead;
                isUpdated   = true;
            }

            SaveData(now, isUpdated);
        }
コード例 #3
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;
 }
コード例 #4
0
 public ConfigBranch(string name)
 {
     this.name           = name;
     this.trackingBranch = null;
     remote = ConfigRemote.Default;
 }
コード例 #5
0
ファイル: Repository.cs プロジェクト: wingyplus/Git-for-Unity
 private static GitRemote GetGitRemote(ConfigRemote configRemote) => new GitRemote(configRemote.Name, configRemote.Url);