aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/setting
diff options
context:
space:
mode:
Diffstat (limited to 'routers/web/repo/setting')
-rw-r--r--routers/web/repo/setting/protected_branch.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/routers/web/repo/setting/protected_branch.go b/routers/web/repo/setting/protected_branch.go
index 777d52c858..b8775cca2d 100644
--- a/routers/web/repo/setting/protected_branch.go
+++ b/routers/web/repo/setting/protected_branch.go
@@ -21,6 +21,7 @@ import (
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/web"
+ "code.gitea.io/gitea/routers/web/repo"
"code.gitea.io/gitea/services/forms"
pull_service "code.gitea.io/gitea/services/pull"
"code.gitea.io/gitea/services/repository"
@@ -44,6 +45,11 @@ func ProtectedBranchRules(ctx *context.Context) {
}
ctx.Data["ProtectedBranches"] = rules
+ repo.PrepareBranchList(ctx)
+ if ctx.Written() {
+ return
+ }
+
ctx.HTML(http.StatusOK, tplBranches)
}
@@ -52,6 +58,11 @@ func SetDefaultBranchPost(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("repo.settings.branches.update_default_branch")
ctx.Data["PageIsSettingsBranches"] = true
+ repo.PrepareBranchList(ctx)
+ if ctx.Written() {
+ return
+ }
+
repo := ctx.Repo.Repository
switch ctx.FormString("action") {