From aa52f44a7ac6b89ee7b2ca187d762a31570bbe66 Mon Sep 17 00:00:00 2001 From: M4RKUS-11111 <73301416+M4RKUS-11111@users.noreply.github.com> Date: Mon, 26 Oct 2020 10:05:27 +0100 Subject: [PATCH 1/2] Deny wrong pull (#13308) * Deny wrong pull * Update routers/api/v1/repo/pull.go Co-authored-by: zeripath Co-authored-by: Markus Co-authored-by: zeripath --- routers/api/v1/repo/pull.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go index e2cab70adc1e1..b2b71180a481e 100644 --- a/routers/api/v1/repo/pull.go +++ b/routers/api/v1/repo/pull.go @@ -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 From fbcfe87ed8dc77af801376c2a45ff46e5eb6f6fc Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 27 Oct 2020 20:15:52 +0100 Subject: [PATCH 2/2] CI.restart()