refactor: remove Ctx field from git.Repository (#38500)

This commit is contained in:
wxiaoguang
2026-07-17 18:44:31 +08:00
committed by GitHub
parent 2c8e99bbf7
commit 5b078f72aa
235 changed files with 1234 additions and 1258 deletions
+4 -4
View File
@@ -16,14 +16,14 @@ import (
func TestBlob_Data(t *testing.T) {
output := "file2\n"
bareRepo1Path := filepath.Join(testReposDir, "repo1_bare")
repo, err := OpenRepository(t.Context(), bareRepo1Path)
repo, err := OpenRepository(bareRepo1Path)
require.NoError(t, err)
defer repo.Close()
testBlob, err := repo.GetBlob("6c493ff740f9380390d5c9ddef4af18697ac9375")
assert.NoError(t, err)
r, err := testBlob.DataAsync()
r, err := testBlob.DataAsync(t.Context())
assert.NoError(t, err)
require.NotNil(t, r)
@@ -36,7 +36,7 @@ func TestBlob_Data(t *testing.T) {
func Benchmark_Blob_Data(b *testing.B) {
bareRepo1Path := filepath.Join(testReposDir, "repo1_bare")
repo, err := OpenRepository(b.Context(), bareRepo1Path)
repo, err := OpenRepository(bareRepo1Path)
if err != nil {
b.Fatal(err)
}
@@ -48,7 +48,7 @@ func Benchmark_Blob_Data(b *testing.B) {
}
for b.Loop() {
r, err := testBlob.DataAsync()
r, err := testBlob.DataAsync(b.Context())
if err != nil {
b.Fatal(err)
}