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
+2 -2
View File
@@ -25,14 +25,14 @@ func getAuthorSignatureSquash(ctx *mergeContext) (*git.Signature, error) {
// Try to get a signature from the same user in one of the commits, as the
// poster email might be private or commits might have a different signature
// than the primary email address of the poster.
gitRepo, err := git.OpenRepository(ctx, ctx.tmpBasePath)
gitRepo, err := git.OpenRepository(ctx.tmpBasePath)
if err != nil {
log.Error("%-v Unable to open base repository: %v", ctx.pr, err)
return nil, err
}
defer gitRepo.Close()
commits, err := gitRepo.CommitsBetween(git.RefNameFromBranch(tmpRepoTrackingBranch), git.RefNameHead, -1)
commits, err := gitRepo.CommitsBetween(ctx, git.RefNameFromBranch(tmpRepoTrackingBranch), git.RefNameHead, -1)
if err != nil {
log.Error("%-v Unable to get commits between: head and tracking branch: %v", ctx.pr, err)
return nil, err