diff options
author | Jimmy Praet <jimmy.praet@telenet.be> | 2022-03-04 09:30:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-04 03:30:49 -0500 |
commit | 5184c83f6b702aeec3ea85263e16ccf5ebe89836 (patch) | |
tree | d5a5f04630815a7342c6e26409faeac75620573b /routers | |
parent | 3c7201682cde10ed551476e13e9e1bfdd971e0c0 (diff) | |
download | gitea-5184c83f6b702aeec3ea85263e16ccf5ebe89836.tar.gz gitea-5184c83f6b702aeec3ea85263e16ccf5ebe89836.zip |
Add config option to disable "Update branch by rebase" (#18745)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/repo/repo.go | 4 | ||||
-rw-r--r-- | routers/web/repo/setting.go | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 7a7fe218e8..560139c457 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -860,6 +860,7 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error { AllowSquash: true, AllowManualMerge: true, AutodetectManualMerge: false, + AllowRebaseUpdate: true, DefaultDeleteBranchAfterMerge: false, DefaultMergeStyle: repo_model.MergeStyleMerge, } @@ -888,6 +889,9 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error { if opts.AutodetectManualMerge != nil { config.AutodetectManualMerge = *opts.AutodetectManualMerge } + if opts.AllowRebaseUpdate != nil { + config.AllowRebaseUpdate = *opts.AllowRebaseUpdate + } if opts.DefaultDeleteBranchAfterMerge != nil { config.DefaultDeleteBranchAfterMerge = *opts.DefaultDeleteBranchAfterMerge } diff --git a/routers/web/repo/setting.go b/routers/web/repo/setting.go index 8e249af55d..5f7b948b8c 100644 --- a/routers/web/repo/setting.go +++ b/routers/web/repo/setting.go @@ -472,6 +472,7 @@ func SettingsPost(ctx *context.Context) { AllowSquash: form.PullsAllowSquash, AllowManualMerge: form.PullsAllowManualMerge, AutodetectManualMerge: form.EnableAutodetectManualMerge, + AllowRebaseUpdate: form.PullsAllowRebaseUpdate, DefaultDeleteBranchAfterMerge: form.DefaultDeleteBranchAfterMerge, DefaultMergeStyle: repo_model.MergeStyle(form.PullsDefaultMergeStyle), }, |