Inheritance: GitVertex
Example #1
0
 public BranchEdge(BranchVertex source, CommitVertex target)
     : base(source, target)
 {
     this.BranchVertex = source;
     this.CommitVertex = target;
 }
Example #2
0
        private CommitVertex AddCommit(GitGraph graph, Commit commit, int depth = 0)
        {
            if (depth > 25)
                return null;

            CommitVertex existing;

            if (graph.TryGetCommitVertex(commit.Sha, out existing))
                return existing;

            var vertex = new CommitVertex(commit);
            graph.AddCommitVertex(vertex);

            foreach (var parent in commit.Parents)
            {
                var parentVertex = AddCommit(graph, parent, depth + 1);

                if (parentVertex != null)
                    graph.AddEdge(new CommitEdge(vertex, parentVertex));
            }

            return vertex;
        }