public async Task CheckReadFormatVersion(int version, bool addOptional, bool optimize) { var path = TestContext.PerTestDirectory((version, addOptional, optimize).ToString()); { using var gc = GitRepository.Open(GitTestEnvironment.GetRepository(GitTestDir.Packed)); await gc.GetPorcelain().Clone(gc.FullPath, path, new() { Shared = true, InitialConfiguration = new[] { ("index.version", $"{version}"), }
public async Task CheckIndexAsync() { using var repo = GitRepository.Open(GitTestEnvironment.GetRepository(GitTestDir.Packed)); var index = FileBucket.OpenRead(Path.Combine(repo.WorkTreeDirectory, "index")); using var dc = new GitDirectoryBucket(index, new() { IdType = GitIdType.Sha1 }); await dc.ReadHeaderAsync(); TestContext.WriteLine($"Version: {dc.IndexVersion}"); while (await dc.ReadEntryAsync() is GitDirectoryEntry entry) { TestContext.WriteLine($"{entry.Name} - {entry}"); } }