mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
* Deny wrong pull (#13308) * Deny wrong pull * Update routers/api/v1/repo/pull.go Co-authored-by: zeripath <[email protected]> Co-authored-by: Markus <[email protected]> Co-authored-by: zeripath <[email protected]> * CI.restart() Co-authored-by: Markus <[email protected]> Co-authored-by: zeripath <[email protected]> Co-authored-by: 6543 <[email protected]>
This commit is contained in:
co-authored by
GitHub
Markus
zeripath
6543
parent
28133a801a
commit
47cb9b3de2
@@ -284,6 +284,12 @@ func CreatePullRequest(ctx *context.APIContext, form api.CreatePullRequestOption
|
||||
// "422":
|
||||
// "$ref": "#/responses/validationError"
|
||||
|
||||
if form.Head == form.Base {
|
||||
ctx.Error(http.StatusUnprocessableEntity, "BaseHeadSame",
|
||||
"Invalid PullRequest: There are no changes between the head and the base")
|
||||
return
|
||||
}
|
||||
|
||||
var (
|
||||
repo = ctx.Repo.Repository
|
||||
labelIDs []int64
|
||||
|
||||
Reference in New Issue
Block a user