aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/branch.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/branch.go')
-rw-r--r--routers/web/repo/branch.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/routers/web/repo/branch.go b/routers/web/repo/branch.go
index 32cfc2adff..991beeace2 100644
--- a/routers/web/repo/branch.go
+++ b/routers/web/repo/branch.go
@@ -12,6 +12,7 @@ import (
"strings"
"code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/git"
@@ -51,9 +52,9 @@ func Branches(ctx *context.Context) {
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["IsWriter"] = ctx.Repo.CanWrite(unit.TypeCode)
ctx.Data["IsMirror"] = ctx.Repo.Repository.IsMirror
- ctx.Data["CanPull"] = ctx.Repo.CanWrite(models.UnitTypeCode) || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID))
+ ctx.Data["CanPull"] = ctx.Repo.CanWrite(unit.TypeCode) || (ctx.IsSigned && ctx.User.HasForkedRepo(ctx.Repo.Repository.ID))
ctx.Data["PageIsViewCode"] = true
ctx.Data["PageIsBranches"] = true
@@ -208,7 +209,7 @@ func loadBranches(ctx *context.Context, skip, limit int) ([]*Branch, int) {
log.Debug("loadOneBranch: load default: '%s'", defaultBranch.Name)
branches = append(branches, loadOneBranch(ctx, defaultBranch, protectedBranches, repoIDToRepo, repoIDToGitRepo))
- if ctx.Repo.CanWrite(models.UnitTypeCode) {
+ if ctx.Repo.CanWrite(unit.TypeCode) {
deletedBranches, err := getDeletedBranches(ctx)
if err != nil {
ctx.ServerError("getDeletedBranches", err)