public bool Equals(ConfigRemote other) { return (String.Equals(name, other.name) && String.Equals(url, other.url) ); }
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); }
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; }
public ConfigBranch(string name) { this.name = name; this.trackingBranch = null; remote = ConfigRemote.Default; }
private static GitRemote GetGitRemote(ConfigRemote configRemote) => new GitRemote(configRemote.Name, configRemote.Url);