public bool Equals(CommitEdge other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Source == other.Source && Target == other.Target); }
private bool AddCommitToGraph(Commit commit, CommitVertex childVertex) { var commitVertex = GetCommitVertex(commit); _graph.AddVertex(commitVertex); if (childVertex != null) { var edge = new CommitEdge(childVertex, commitVertex); if (_edges.ContainsKey(edge.Id)) { return(false); } _graph.AddEdge(edge); _edges.Add(edge.Id, edge); } return(true); }
private void AddCommitsToGraph(Commit commit, CommitVertex childVertex) { var commitVertex = GetCommitVertex(commit); _graph.AddVertex(commitVertex); if (childVertex != null) { var edge = new CommitEdge(childVertex, commitVertex); if (_edges.ContainsKey(edge.Id)) { return; } _graph.AddEdge(edge); _edges.Add(edge.Id, edge); } foreach (var parent in commit.Parents) { AddCommitsToGraph(parent, commitVertex); } }