Skip to content

Commit ff1b000

Browse files
M4RKUS-11111M4RKUS28zeripath
authored
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]>
1 parent c40df54 commit ff1b000

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
@@ -284,6 +284,12 @@ func CreatePullRequest(ctx *context.APIContext, form api.CreatePullRequestOption
284284
// "422":
285285
// "$ref": "#/responses/validationError"
286286

287+
if form.Head == form.Base {
288+
ctx.Error(http.StatusUnprocessableEntity, "BaseHeadSame",
289+
"Invalid PullRequest: There are no changes between the head and the base")
290+
return
291+
}
292+
287293
var (
288294
repo = ctx.Repo.Repository
289295
labelIDs []int64

0 commit comments

Comments
 (0)