aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web/repo/setting
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-03-06 14:26:32 +0800
committerGitHub <noreply@github.com>2024-03-06 14:26:32 +0800
commit5cddab4f74bbb307ddf13e458c7ac22f93b9283a (patch)
tree2eee924ffdbc2e1bedb6b63020e7b7fdd86417c3 /routers/web/repo/setting
parentda15d6127c8d430dfc069f9815ce783dd9ca35f7 (diff)
downloadgitea-5cddab4f74bbb307ddf13e458c7ac22f93b9283a.tar.gz
gitea-5cddab4f74bbb307ddf13e458c7ac22f93b9283a.zip
Make wiki default branch name changable (#29603)
Fix #29000 Fix #28685 Fix #18568 Related: #27497 And by the way fix #24036, add a Cancel button there (one line)
Diffstat (limited to 'routers/web/repo/setting')
-rw-r--r--routers/web/repo/setting/setting.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/routers/web/repo/setting/setting.go b/routers/web/repo/setting/setting.go
index 992a980d9e..e045e3b8dc 100644
--- a/routers/web/repo/setting/setting.go
+++ b/routers/web/repo/setting/setting.go
@@ -488,6 +488,13 @@ func SettingsPost(ctx *context.Context) {
}
}
+ if form.DefaultWikiBranch != "" {
+ if err := wiki_service.ChangeDefaultWikiBranch(ctx, repo, form.DefaultWikiBranch); err != nil {
+ log.Error("ChangeDefaultWikiBranch failed, err: %v", err)
+ ctx.Flash.Warning(ctx.Tr("repo.settings.failed_to_change_default_wiki_branch"))
+ }
+ }
+
if form.EnableIssues && form.EnableExternalTracker && !unit_model.TypeExternalTracker.UnitGlobalDisabled() {
if !validation.IsValidExternalURL(form.ExternalTrackerURL) {
ctx.Flash.Error(ctx.Tr("repo.settings.external_tracker_url_error"))