Add local batched Git blob reader

This commit is contained in:
2026-10-09 01:23:00 +00:00
parent 618a7c9dd3
commit 33e10635b6
7 changed files with 508 additions and 6 deletions

View File

@@ -62,6 +62,13 @@ func TestCandidateObjectReadsStayLocalInPartialClones(t *testing.T) {
if !errors.As(err, &exitError) {
t.Fatalf("blob error %v lost its Git process cause", err)
}
reader := NewBlobReader(t.Context(), repository)
if _, err := reader.Read(t.Context(), blob); err == nil || !strings.Contains(err.Error(), "missing") {
t.Fatalf("batch blob read error = %v, want missing-object inspection error", err)
}
if err := reader.Close(); err != nil {
t.Fatalf("close missing-object batch reader: %v", err)
}
if data, err := os.ReadFile(attempts); !errors.Is(err, os.ErrNotExist) {
t.Fatalf("object inspection invoked remote transport: %q, %v", data, err)
}