1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-14 22:47:21 +00:00

Move git references checking to gitrepo packages to reduce expose of repository path (#33891)

This commit is contained in:
Lunny Xiao
2025-03-15 19:48:59 -07:00
committed by GitHub
parent f11ac6bf3c
commit 0056fdb942
24 changed files with 79 additions and 46 deletions

View File

@ -742,7 +742,7 @@ func EditPullRequest(ctx *context.APIContext) {
// change pull target branch
if !pr.HasMerged && len(form.Base) != 0 && form.Base != pr.BaseBranch {
if !ctx.Repo.GitRepo.IsBranchExist(form.Base) {
if !gitrepo.IsBranchExist(ctx, ctx.Repo.Repository, form.Base) {
ctx.APIError(http.StatusNotFound, fmt.Errorf("new base '%s' not exist", form.Base))
return
}