Add DefaultMergeStyle option to repository (#14789)

Fixes #12293
This commit is contained in:
parnic authored and GitHub committed 2021-03-27 15:55:40 +01:00
1 parent 6b836ac5f7
commit f4d27498bd
11 files changed
+70 -2

No files matched your search

+4
View File
@@ -731,6 +731,7 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error {
AllowSquash: true,
AllowManualMerge: true,
AutodetectManualMerge: false,
DefaultMergeStyle: models.MergeStyleMerge,
}
} else {
config = unit.PullRequestsConfig()
@@ -757,6 +758,9 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error {
if opts.AutodetectManualMerge != nil {
config.AutodetectManualMerge = *opts.AutodetectManualMerge
}
if opts.DefaultMergeStyle != nil {
config.DefaultMergeStyle = models.MergeStyle(*opts.DefaultMergeStyle)
}
units = append(units, models.RepoUnit{
RepoID: repo.ID,