From 150f9738ff4c1749f9fca9cb857fd69044ef3ce5 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Fri, 29 Jul 2022 19:51:22 -0400 Subject: [PATCH] fixed exception --- DrillSergeant.csproj | 4 +++- Program.cs | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/DrillSergeant.csproj b/DrillSergeant.csproj index dd79470..1720889 100644 --- a/DrillSergeant.csproj +++ b/DrillSergeant.csproj @@ -1,6 +1,7 @@ + true Exe net6.0 enable @@ -10,7 +11,8 @@ - + + diff --git a/Program.cs b/Program.cs index 753919a..dba23b0 100644 --- a/Program.cs +++ b/Program.cs @@ -1,25 +1,25 @@ using LibGit2Sharp; -static class Public +static class Program { internal static void Main(string[] args) { List authors = new List(); Dictionary commitReport = new Dictionary(); - using (var repo = new Repository(@".")) + using (var repo = new Repository(Directory.GetCurrentDirectory())) { foreach (var c in repo.Commits) { - if (!authors.Contains(c.Author.Email)) + if (!authors.Contains(c.Author.Name)) { - authors.Add(c.Author.Email); + authors.Add(c.Author.Name); } } foreach (var a in authors) { - int commitCount = repo.Commits.OrderBy(a => a.Author).Count(); + int commitCount = repo.Commits.Where(r => r.Author.Name == a).Count(); commitReport.Add(a, commitCount); }