fixed exception

This commit is contained in:
Wyatt J. Miller 2022-07-29 19:51:22 -04:00
parent f732a666af
commit 150f9738ff
2 changed files with 8 additions and 6 deletions

View File

@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
@ -10,7 +11,8 @@
<ItemGroup>
<PackageReference Include="IronPdf" Version="2022.8.7894" />
<PackageReference Include="IronXL.Excel" Version="2022.7.7362" />
<PackageReference Include="Libgit2sharp" Version="0.26.2" />
<PackageReference Include="Libgit2sharp" Version="0.27.0-preview-0182" />
<PackageReference Include="LibGit2Sharp.NativeBinaries" Version="2.0.315-alpha.0.9" />
</ItemGroup>
</Project>

View File

@ -1,25 +1,25 @@
using LibGit2Sharp;
static class Public
static class Program
{
internal static void Main(string[] args)
{
List<string> authors = new List<string>();
Dictionary<string, int> commitReport = new Dictionary<string, int>();
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);
}