Skip to content

Commit 732f22a

Browse files
M4RKUS-11111M4RKUS28zeripath
authored
Deny wrong pull (#13308) (#13327)
* Deny wrong pull * Update routers/api/v1/repo/pull.go Co-authored-by: Markus <[email protected]> Co-authored-by: zeripath <[email protected]>
1 parent c9e6069 commit 732f22a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

routers/api/v1/repo/pull.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,12 @@ func CreatePullRequest(ctx *context.APIContext, form api.CreatePullRequestOption
201201
// "422":
202202
// "$ref": "#/responses/validationError"
203203

204+
if form.Head == form.Base {
205+
ctx.Error(http.StatusUnprocessableEntity, "BaseHeadSame",
206+
"Invalid PullRequest: There are no changes between the head and the base")
207+
return
208+
}
209+
204210
var (
205211
repo = ctx.Repo.Repository
206212
labelIDs []int64

0 commit comments

Comments
 (0)