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
+3 -3
View File
@@ -306,11 +306,11 @@ func RepoRefForAPI(next http.Handler) http.Handler {
var err error
switch refType {
case git.RefTypeBranch:
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(refName)
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetBranchCommit(ctx, refName)
case git.RefTypeTag:
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetTagCommit(refName)
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetTagCommit(ctx, refName)
case git.RefTypeCommit:
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommit(refName)
ctx.Repo.Commit, err = ctx.Repo.GitRepo.GetCommit(ctx, refName)
}
if ctx.Repo.Commit == nil || errors.Is(err, util.ErrNotExist) {
ctx.APIErrorNotFound("unable to find a git ref")