summaryrefslogtreecommitdiffstats
path: root/routers/repo/branch.go
diff options
context:
space:
mode:
authorGary Kim <gary@garykim.dev>2019-07-11 20:21:16 +0000
committertechknowlogick <techknowlogick@gitea.io>2019-07-11 16:21:16 -0400
commit072bdfa3f50591863d523202e6d8a0fac0ca7ea7 (patch)
tree8758acbf265b47e1f4df8690c61cd8a9f2878e0e /routers/repo/branch.go
parenta7b1ba0e3d49e699ce7d6e614bc8605aef0a2c9a (diff)
downloadgitea-072bdfa3f50591863d523202e6d8a0fac0ca7ea7.tar.gz
gitea-072bdfa3f50591863d523202e6d8a0fac0ca7ea7.zip
Only show "New Pull Request" button if repo allows pulls (#7426)
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'routers/repo/branch.go')
-rw-r--r--routers/repo/branch.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go
index 708b33be09..3bd4a75bfb 100644
--- a/routers/repo/branch.go
+++ b/routers/repo/branch.go
@@ -39,6 +39,7 @@ func Branches(ctx *context.Context) {
ctx.Data["Title"] = "Branches"
ctx.Data["IsRepoToolbarBranches"] = true
ctx.Data["DefaultBranch"] = ctx.Repo.Repository.DefaultBranch
+ ctx.Data["AllowsPulls"] = ctx.Repo.Repository.AllowsPulls()
ctx.Data["IsWriter"] = ctx.Repo.CanWrite(models.UnitTypeCode)
ctx.Data["IsMirror"] = ctx.Repo.Repository.IsMirror
ctx.Data["PageIsViewCode"] = true