Closed
Description
To calculate AheadBehind
with two local branches.
My application level code is
using (var repo = new Repository(@"\libgit2sharp"))
{
var head = repo.Head;
var branch = repo.Branches["vNext"];
var commitLog = repo.Commits;
var commonAncestor = commitLog.FindCommonAncestor(head.Tip, branch.Tip);
var ahead = commitLog.QueryBy(new CommitFilter { Since = branch.Tip, Until = commonAncestor });
var behind = commitLog.QueryBy(new CommitFilter { Since = head.Tip, Until = commonAncestor });
var Ahead = ahead.Count();
var Behind = behind.Count();
}
But it very slowly and the result not very equals to github. It is available in libgit2
?
Metadata
Metadata
Assignees
Labels
No labels