public HashSet <T> CherryPick(string id) { if (!Commits.ContainsKey(id)) { throw new KeyNotFoundException(); } return(Commits[id].HashSet); }
public Log Log(string id) { if (!Commits.ContainsKey(id)) { throw new KeyNotFoundException(); } var commit = Commits[id]; return(new Log(id, commit.Message)); }
public void Checkout(string id) { if (!Commits.ContainsKey(id)) { throw new KeyNotFoundException(); } Clear(); foreach (var commit in Commits[id].HashSet) { Add(commit); } }
/// <summary> /// Разрешает коммит по имени или по псевдониму /// </summary> /// <param name="hashOrAlias"></param> /// <returns></returns> public Commit Resolve(string hashOrAlias) { var hash = hashOrAlias; if (Aliases.ContainsKey(hashOrAlias)) { hash = Aliases[hashOrAlias]; } if (Commits.ContainsKey(hash)) { return(Commits[hash]); } return(null); }
private void AddCommits(IEnumerable <GitCommit> commits) { foreach (var v in commits) { if (v == null) { return; } if (Commits.ContainsKey(v.Id)) { return; } Commits.Add(v.Id, new GitCommitInfo(v.Id, Repository)); } }