aboutsummaryrefslogtreecommitdiffstats
path: root/models/repo
diff options
context:
space:
mode:
authorttys3 <41882455+ttys3@users.noreply.github.com>2022-06-03 11:45:54 +0800
committerGitHub <noreply@github.com>2022-06-02 23:45:54 -0400
commit0c759fd4dee1c2a82ecdb0a6019d8ee78dae2209 (patch)
tree54ceb9a1bf1e750188f8cce9380e0f6a7898217e /models/repo
parent808a7803098bd86c83185cb823c5b0e2a5b2c56d (diff)
downloadgitea-0c759fd4dee1c2a82ecdb0a6019d8ee78dae2209.tar.gz
gitea-0c759fd4dee1c2a82ecdb0a6019d8ee78dae2209.zip
feat: add DEFAULT_MERGE_STYLE to `repository.pull-request` section for repo init (#19751)
Diffstat (limited to 'models/repo')
-rw-r--r--models/repo/repo_unit.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/models/repo/repo_unit.go b/models/repo/repo_unit.go
index a73678c6ef..8c17d6138c 100644
--- a/models/repo/repo_unit.go
+++ b/models/repo/repo_unit.go
@@ -11,6 +11,7 @@ import (
"code.gitea.io/gitea/models/db"
"code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/json"
+ "code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/timeutil"
"xorm.io/xorm"
@@ -148,6 +149,10 @@ func (cfg *PullRequestsConfig) GetDefaultMergeStyle() MergeStyle {
return cfg.DefaultMergeStyle
}
+ if setting.Repository.PullRequest.DefaultMergeStyle != "" {
+ return MergeStyle(setting.Repository.PullRequest.DefaultMergeStyle)
+ }
+
return MergeStyleMerge
}