public bool DoesBranchContainCommit(string branchName, string commitOrBranchName)
{
using (var repo = new LibGit2Sharp.Repository(RepositoryPath))
{
var branch = repo.Branches[branchName];
if (branch == null) return false;
return repo.Refs.ReachableFrom(
new[] { repo.Refs[branch.CanonicalName] },
new[] { repo.Lookup<Commit>(commitOrBranchName) }).Any();
}
}