mirror of
https://github.com/go-gitea/gitea
synced 2024-11-25 02:32:49 +01:00
Deny wrong pull (#13308)
* Deny wrong pull * Update routers/api/v1/repo/pull.go Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Markus <git+markus@obermui.de> Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
parent
c40df54e28
commit
ff1b00002a
1 changed files with 6 additions and 0 deletions
|
@ -284,6 +284,12 @@ func CreatePullRequest(ctx *context.APIContext, form api.CreatePullRequestOption
|
||||||
// "422":
|
// "422":
|
||||||
// "$ref": "#/responses/validationError"
|
// "$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 (
|
var (
|
||||||
repo = ctx.Repo.Repository
|
repo = ctx.Repo.Repository
|
||||||
labelIDs []int64
|
labelIDs []int64
|
||||||
|
|
Loading…
Reference in a new issue