aboutsummaryrefslogtreecommitdiffstats
path: root/routers/repo
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2020-11-29 03:30:46 +0800
committerGitHub <noreply@github.com>2020-11-28 21:30:46 +0200
commit9c26dc1f3a742280baff4e9578545bc822016764 (patch)
treeac997d23e59a658b387302ecd65e76a39d99b9e8 /routers/repo
parent7ed5bf8cbe06bf2cfc4980cf6e020dc46dd71a79 (diff)
downloadgitea-9c26dc1f3a742280baff4e9578545bc822016764.tar.gz
gitea-9c26dc1f3a742280baff4e9578545bc822016764.zip
Add block on official review requests branch protection (#13705)
Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'routers/repo')
-rw-r--r--routers/repo/issue.go1
-rw-r--r--routers/repo/setting_protected_branch.go1
2 files changed, 2 insertions, 0 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index ded9b3c208..6ebc5d6ecb 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -1455,6 +1455,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["IsBlockedByOfficialReviewRequests"] = pull.ProtectedBranch.MergeBlockedByOfficialReviewRequests(pull)
ctx.Data["IsBlockedByOutdatedBranch"] = pull.ProtectedBranch.MergeBlockedByOutdatedBranch(pull)
ctx.Data["GrantedApprovals"] = cnt
ctx.Data["RequireSigned"] = pull.ProtectedBranch.RequireSignedCommits
diff --git a/routers/repo/setting_protected_branch.go b/routers/repo/setting_protected_branch.go
index f864e8a75c..c2e7bc8fac 100644
--- a/routers/repo/setting_protected_branch.go
+++ b/routers/repo/setting_protected_branch.go
@@ -246,6 +246,7 @@ func SettingsProtectedBranchPost(ctx *context.Context, f auth.ProtectBranchForm)
}
}
protectBranch.BlockOnRejectedReviews = f.BlockOnRejectedReviews
+ protectBranch.BlockOnOfficialReviewRequests = f.BlockOnOfficialReviewRequests
protectBranch.DismissStaleApprovals = f.DismissStaleApprovals
protectBranch.RequireSignedCommits = f.RequireSignedCommits
protectBranch.ProtectedFilePatterns = f.ProtectedFilePatterns