mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-20 19:52:04 +00:00
Backport #26986 by @norohind Fix #20175 Current implementation of API does not allow creating pull requests between branches of the same repo when you specify *namespace* (owner of the repo) in `head` field in http request body. --------- Co-authored-by: norohind <60548839+norohind@users.noreply.github.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> (cherry picked from commit 408c92938ba6f38eea1210cae2c485e1f19d4982)
This commit is contained in:
parent
ee87a652e9
commit
120a173e24
2 changed files with 19 additions and 0 deletions
|
@ -972,6 +972,8 @@ func parseCompareInfo(ctx *context.APIContext, form api.CreatePullRequestOption)
|
|||
return nil, nil, nil, nil, "", ""
|
||||
}
|
||||
headBranch = headInfos[1]
|
||||
// The head repository can also point to the same repo
|
||||
isSameRepo = ctx.Repo.Owner.ID == headUser.ID
|
||||
|
||||
} else {
|
||||
ctx.NotFound()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue