mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-16 19:07:41 +02:00
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:
parent
1edbc21fcc
commit
ef88cdb7e7
@ -1162,6 +1162,9 @@ LEVEL = Info
|
|||||||
;; Delay mergeable check until page view or API access, for pull requests that have not been updated in the specified days when their base branches get updated.
|
;; Delay mergeable check until page view or API access, for pull requests that have not been updated in the specified days when their base branches get updated.
|
||||||
;; Use "-1" to always check all pull requests (old behavior). Use "0" to always delay the checks.
|
;; Use "-1" to always check all pull requests (old behavior). Use "0" to always delay the checks.
|
||||||
;DELAY_CHECK_FOR_INACTIVE_DAYS = 7
|
;DELAY_CHECK_FOR_INACTIVE_DAYS = 7
|
||||||
|
;;
|
||||||
|
;; Set the default value for "Delete pull request branch after merge by default" for new repositories
|
||||||
|
;DEFAULT_DELETE_BRANCH_AFTER_MERGE = false
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|||||||
@ -142,6 +142,7 @@ func DefaultPullRequestsConfig() *PullRequestsConfig {
|
|||||||
AllowRebaseUpdate: true,
|
AllowRebaseUpdate: true,
|
||||||
DefaultAllowMaintainerEdit: true,
|
DefaultAllowMaintainerEdit: true,
|
||||||
}
|
}
|
||||||
|
cfg.DefaultDeleteBranchAfterMerge = setting.Repository.PullRequest.DefaultDeleteBranchAfterMerge
|
||||||
cfg.DefaultMergeStyle = MergeStyle(setting.Repository.PullRequest.DefaultMergeStyle)
|
cfg.DefaultMergeStyle = MergeStyle(setting.Repository.PullRequest.DefaultMergeStyle)
|
||||||
cfg.DefaultMergeStyle = util.IfZero(cfg.DefaultMergeStyle, MergeStyleMerge)
|
cfg.DefaultMergeStyle = util.IfZero(cfg.DefaultMergeStyle, MergeStyleMerge)
|
||||||
return cfg
|
return cfg
|
||||||
|
|||||||
@ -89,6 +89,7 @@ var (
|
|||||||
TestConflictingPatchesWithGitApply bool
|
TestConflictingPatchesWithGitApply bool
|
||||||
RetargetChildrenOnMerge bool
|
RetargetChildrenOnMerge bool
|
||||||
DelayCheckForInactiveDays int
|
DelayCheckForInactiveDays int
|
||||||
|
DefaultDeleteBranchAfterMerge bool
|
||||||
} `ini:"repository.pull-request"`
|
} `ini:"repository.pull-request"`
|
||||||
|
|
||||||
// Issue Setting
|
// Issue Setting
|
||||||
@ -213,6 +214,7 @@ var (
|
|||||||
TestConflictingPatchesWithGitApply bool
|
TestConflictingPatchesWithGitApply bool
|
||||||
RetargetChildrenOnMerge bool
|
RetargetChildrenOnMerge bool
|
||||||
DelayCheckForInactiveDays int
|
DelayCheckForInactiveDays int
|
||||||
|
DefaultDeleteBranchAfterMerge bool
|
||||||
}{
|
}{
|
||||||
WorkInProgressPrefixes: []string{"WIP:", "[WIP]"},
|
WorkInProgressPrefixes: []string{"WIP:", "[WIP]"},
|
||||||
// Same as GitHub. See
|
// Same as GitHub. See
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user