public void AddRemoteBranch(string remote, string branch) { Dictionary <string, ConfigBranch> branchList; if (RemoteConfigBranches.TryGetValue(remote, out branchList)) { if (!branchList.ContainsKey(branch)) { var now = DateTimeOffset.Now; branchList.Add(branch, new ConfigBranch { Name = branch, Remote = ConfigRemotes[remote] }); Logger.Trace("AddRemoteBranch {0} remote:{1} branch:{2} ", now, remote, branch); SaveData(now, true); } else { Logger.Warning("Branch {0} is already present in Remote {1}", branch, remote); } } else { Logger.Warning("Remote {0} is not found", remote); } }
public void RemoveRemoteBranch(string remote, string branch) { Dictionary <string, ConfigBranch> branchList; if (RemoteConfigBranches.TryGetValue(remote, out branchList)) { if (branchList.ContainsKey(branch)) { var now = DateTimeOffset.Now; branchList.Remove(branch); Logger.Trace("RemoveRemoteBranch {0} remote:{1} branch:{2} ", now, remote, branch); SaveData(now, true); } else { Logger.Warning("Branch {0} is not found in Remote {1}", branch, remote); } } else { Logger.Warning("Remote {0} is not found", remote); } }