From c52d48aae46af879fdfcfd94d03b7072878b5441 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Fri, 17 Apr 2020 03:00:36 +0200 Subject: Prevent merge of outdated PRs on protected branches (#11012) * Block PR on Outdated Branch * finalize * cleanup * fix typo and sentences thanks @guillep2k Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: Lauris BH --- routers/repo/issue.go | 1 + 1 file changed, 1 insertion(+) (limited to 'routers/repo/issue.go') diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 3655de7ed4..9ad379684a 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -1065,6 +1065,7 @@ func ViewIssue(ctx *context.Context) { cnt := pull.ProtectedBranch.GetGrantedApprovalsCount(pull) ctx.Data["IsBlockedByApprovals"] = !pull.ProtectedBranch.HasEnoughApprovals(pull) ctx.Data["IsBlockedByRejection"] = pull.ProtectedBranch.MergeBlockedByRejectedReview(pull) + ctx.Data["IsBlockedByOutdatedBranch"] = pull.ProtectedBranch.MergeBlockedByOutdatedBranch(pull) ctx.Data["GrantedApprovals"] = cnt ctx.Data["RequireSigned"] = pull.ProtectedBranch.RequireSignedCommits } -- cgit v1.2.3