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

View File

@@ -78,7 +78,7 @@ func CreateCommitStatus(ctx context.Context, repo *repo_model.Repository, creato
objectFormat := git.ObjectFormatFromName(repo.ObjectFormatName)
commit, err := gitRepo.GetCommit(sha)
commit, err := gitRepo.GetCommit(ctx, sha)
if err != nil {
return fmt.Errorf("GetCommit[%s]: %w", sha, err)
}
@@ -104,7 +104,7 @@ func CreateCommitStatus(ctx context.Context, repo *repo_model.Repository, creato
notify.CreateCommitStatus(ctx, repo, repo_module.CommitToPushCommit(commit), creator, status)
defaultBranchCommit, err := gitRepo.GetBranchCommit(repo.DefaultBranch)
defaultBranchCommit, err := gitRepo.GetBranchCommit(ctx, repo.DefaultBranch)
if err != nil {
return fmt.Errorf("GetBranchCommit[%s]: %w", repo.DefaultBranch, err)
}