Add DEFAULT_DELETE_BRANCH_AFTER_MERGE setting (#36917)

Add this config option, applying to new repos:

```ini
[repository.pull-request]
DEFAULT_DELETE_BRANCH_AFTER_MERGE = true
```

Defaults to `false`, preserving current behavior.

---------

Co-authored-by: Claude (Opus 4.6) <noreply@anthropic.com>
This commit is contained in:
silverwind
2026-03-23 18:34:45 +01:00
committed by GitHub
parent 1edbc21fcc
commit ef88cdb7e7
3 changed files with 6 additions and 0 deletions

View File

@@ -142,6 +142,7 @@ func DefaultPullRequestsConfig() *PullRequestsConfig {
AllowRebaseUpdate: true,
DefaultAllowMaintainerEdit: true,
}
cfg.DefaultDeleteBranchAfterMerge = setting.Repository.PullRequest.DefaultDeleteBranchAfterMerge
cfg.DefaultMergeStyle = MergeStyle(setting.Repository.PullRequest.DefaultMergeStyle)
cfg.DefaultMergeStyle = util.IfZero(cfg.DefaultMergeStyle, MergeStyleMerge)
return cfg