diff options
author | qwerty287 <80460567+qwerty287@users.noreply.github.com> | 2021-10-17 18:58:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-17 17:58:36 +0100 |
commit | 26dfe88ff2431234c0b9cc172c6b62562a03aab8 (patch) | |
tree | 19b4fc73eeb84bb38256af27b02a923eab22989d /routers | |
parent | 554988c7b23aef99c226986509ab55ce74af7671 (diff) | |
download | gitea-26dfe88ff2431234c0b9cc172c6b62562a03aab8.tar.gz gitea-26dfe88ff2431234c0b9cc172c6b62562a03aab8.zip |
Hide command line merge instructions when user can't push (#17339)
Hides the command line instructions if the authenticated user can't push to the base branch.
Closes #17121
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/issue.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/routers/web/repo/issue.go b/routers/web/repo/issue.go index 1aaa27c2b0..173cb49e45 100644 --- a/routers/web/repo/issue.go +++ b/routers/web/repo/issue.go @@ -1543,6 +1543,7 @@ func ViewIssue(ctx *context.Context) { ctx.ServerError("LoadProtectedBranch", err) return } + ctx.Data["ShowMergeInstructions"] = true if pull.ProtectedBranch != nil { cnt := pull.ProtectedBranch.GetGrantedApprovalsCount(pull) ctx.Data["IsBlockedByApprovals"] = !pull.ProtectedBranch.HasEnoughApprovals(pull) @@ -1554,6 +1555,7 @@ func ViewIssue(ctx *context.Context) { ctx.Data["ChangedProtectedFiles"] = pull.ChangedProtectedFiles ctx.Data["IsBlockedByChangedProtectedFiles"] = len(pull.ChangedProtectedFiles) != 0 ctx.Data["ChangedProtectedFilesNum"] = len(pull.ChangedProtectedFiles) + ctx.Data["ShowMergeInstructions"] = pull.ProtectedBranch.CanUserPush(ctx.User.ID) } ctx.Data["WillSign"] = false if ctx.User != nil { |