Skip to content

Commit

Permalink
Deny wrong pull (go-gitea#13308)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people committed Oct 27, 2020
1 parent 28133a8 commit aa52f44
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions routers/api/v1/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aa52f44

Please sign in to comment.