added commit filtering by tag

This commit is contained in:
Wyatt J. Miller 2022-08-23 18:56:56 -04:00
parent 9e312e9c6c
commit e4d8e3f66e

View File

@ -120,8 +120,29 @@ public class CommitDetail
{ {
using (var repo = new Repository(Directory.GetCurrentDirectory())) using (var repo = new Repository(Directory.GetCurrentDirectory()))
{ {
var tagResult = repo.Tags[tagName]; var tagResult = repo.Tags[tagName].Target.Sha;
System.Console.WriteLine(tagResult);
var commitFilter = new CommitFilter
{
IncludeReachableFrom = tagResult,
};
var query = repo.Commits.QueryBy(commitFilter);
foreach (var c in query)
{
if (!_authors.Contains(c.Author.Name))
{
_authors.Add(c.Author.Name);
}
}
foreach (var a in _authors)
{
int commitCount = query.Where(r => r.Author.Name == a).Count();
_commitDetails.Add(a, commitCount);
}
} }
} }
} }