mirror of
https://github.com/go-gitea/gitea.git
synced 2026-01-09 05:41:29 +01:00
Always honor user's choice for "delete branch after merge" (#36281)
Fix #36280
This commit is contained in:
@@ -32,6 +32,7 @@ import (
|
||||
"code.gitea.io/gitea/modules/graceful"
|
||||
issue_template "code.gitea.io/gitea/modules/issue/template"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/optional"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/templates"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
@@ -1136,11 +1137,9 @@ func MergePullRequest(ctx *context.Context) {
|
||||
message += "\n\n" + form.MergeMessageField
|
||||
}
|
||||
|
||||
deleteBranchAfterMerge, err := pull_service.ShouldDeleteBranchAfterMerge(ctx, form.DeleteBranchAfterMerge, ctx.Repo.Repository, pr)
|
||||
if err != nil {
|
||||
ctx.ServerError("ShouldDeleteBranchAfterMerge", err)
|
||||
return
|
||||
}
|
||||
// There is always a checkbox on the UI (the DeleteBranchAfterMerge is nil if the checkbox is not checked),
|
||||
// just use the user's choice, don't use pull_service.ShouldDeleteBranchAfterMerge to decide
|
||||
deleteBranchAfterMerge := optional.FromPtr(form.DeleteBranchAfterMerge).Value()
|
||||
|
||||
if form.MergeWhenChecksSucceed {
|
||||
// delete all scheduled auto merges
|
||||
|
||||
Reference in New Issue
Block a user