Browse Source

Deny wrong pull (#13308) (#13326)

* 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>

* CI.restart()

Co-authored-by: Markus <git+markus@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
tags/v1.13.0-rc2
M4RKUS-11111 3 years ago
parent
commit
47cb9b3de2
No account linked to committer's email address
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      routers/api/v1/repo/pull.go

+ 6
- 0
routers/api/v1/repo/pull.go View File

@@ -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

Loading…
Cancel
Save