Skip to content

Commit 47cb9b3

Browse files
M4RKUS-11111M4RKUS28zeripath6543
authored
Deny wrong pull (#13308) (#13326)
* 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]> * CI.restart() Co-authored-by: Markus <[email protected]> Co-authored-by: zeripath <[email protected]> Co-authored-by: 6543 <[email protected]>
1 parent 28133a8 commit 47cb9b3

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)