diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-03-06 14:26:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-06 14:26:32 +0800 |
commit | 5cddab4f74bbb307ddf13e458c7ac22f93b9283a (patch) | |
tree | 2eee924ffdbc2e1bedb6b63020e7b7fdd86417c3 /routers/web/repo/setting | |
parent | da15d6127c8d430dfc069f9815ce783dd9ca35f7 (diff) | |
download | gitea-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.go | 7 |
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")) |