Move catfile batch to a sub package of git module (#36232)

This commit is contained in:
Lunny Xiao
2025-12-29 10:19:42 -08:00
committed by GitHub
parent d0cb198c89
commit 0ad94dfc70
17 changed files with 500 additions and 412 deletions
+4 -1
View File
@@ -47,12 +47,15 @@ func FindLFSFile(repo *git.Repository, objectID git.ObjectID) ([]*LFSResult, err
// Next feed the commits in order into cat-file --batch, followed by their trees and sub trees as necessary.
// so let's create a batch stdin and stdout
batchStdinWriter, batchReader, cancel, err := repo.CatFileBatch(repo.Ctx)
batch, cancel, err := repo.CatFileBatch(repo.Ctx)
if err != nil {
return nil, err
}
defer cancel()
batchStdinWriter := batch.Writer()
batchReader := batch.Reader()
// We'll use a scanner for the revList because it's simpler than a bufio.Reader
scan := bufio.NewScanner(revListReader)
trees := [][]byte{}