mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-12-08 16:01:27 +08:00
Move git references checking to gitrepo packages to reduce expose of repository path (#33891)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user