summary refs log tree commit diff
path: root/LibGitTest/Test3.cs
blob: 24d6986057815fc45ec7db69285d43a1dcbeaf2c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using LibGit;

namespace LibGitTest;

public class Test3
{
    public static async Task Run()
    {
        Console.WriteLine("Test3 running");
        var repo = new GitRepo(new FileRepoSource(@"/home/Rory/git/spacebar/server-master/.git"));
        var packs = repo.GetPacks().GetAsyncEnumerator();
        int count = 0;
        while(await packs.MoveNextAsync())
        {
            count += packs.Current.ObjectCount;
            // Console.WriteLine(packs.Current.ToJson());
        }
        Console.WriteLine($"Read {count} objects from pack files.");
    }
}