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
@@ -221,10 +221,10 @@ func testEditorWebGitCommitEmail(t *testing.T) {
require.True(t, user.KeepEmailPrivate)
repo1 := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 1})
gitRepo, _ := gitrepo.OpenRepository(t.Context(), repo1)
gitRepo, _ := gitrepo.OpenRepository(repo1)
defer gitRepo.Close()
getLastCommit := func(t *testing.T) *git.Commit {
c, err := gitRepo.GetBranchCommit("master")
c, err := gitRepo.GetBranchCommit(t.Context(), "master")
require.NoError(t, err)
return c
}
@@ -349,9 +349,9 @@ index 0000000000..bbbbbbbbbb
},
)
commit1, err := gitRepo.GetCommitByPath("patch-file-1.txt")
commit1, err := gitRepo.GetCommitByPath(t.Context(), "patch-file-1.txt")
require.NoError(t, err)
commit2, err := gitRepo.GetCommitByPath("patch-file-2.txt")
commit2, err := gitRepo.GetCommitByPath(t.Context(), "patch-file-2.txt")
require.NoError(t, err)
resp1, _ := testWebGit(t,
"/user2/repo1/_cherrypick/"+commit1.ID.String()+"/master", map[string]string{"revert": "true"},