aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorJimmy Praet <jimmy.praet@telenet.be>2021-07-13 01:26:25 +0200
committerGitHub <noreply@github.com>2021-07-13 01:26:25 +0200
commit78118a3b029ee4eb140d47be22e86df17253a786 (patch)
tree81aaa17946b3bd8086cdb6e23ca4349dea118f50 /models
parent46a4c6835daf4642074bb1a18a3210b03a64259b (diff)
downloadgitea-78118a3b029ee4eb140d47be22e86df17253a786.tar.gz
gitea-78118a3b029ee4eb140d47be22e86df17253a786.zip
Add checkbox to delete pull branch after successful merge (#16049)
* Add checkbox to delete pull branch after successful merge * Omit DeleteBranchAfterMerge field in json * Log a warning instead of error when PR head branch deleted * Add DefaultDeleteBranchAfterMerge to PullRequestConfig * Add support for delete_branch_after_merge via API * Fix for API: the branch should be deleted from the HEAD repo If head and base repo are the same, reuse the already opened ctx.Repo.GitRepo * Don't delegate to CleanupBranch, only reuse branch deletion code CleanupBranch contains too much logic that has already been performed by the Merge * Reuse gitrepo in MergePullRequest Co-authored-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'models')
-rw-r--r--models/repo_unit.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/models/repo_unit.go b/models/repo_unit.go
index d8060d16a0..a12e056a7d 100644
--- a/models/repo_unit.go
+++ b/models/repo_unit.go
@@ -91,14 +91,15 @@ func (cfg *IssuesConfig) ToDB() ([]byte, error) {
// PullRequestsConfig describes pull requests config
type PullRequestsConfig struct {
- IgnoreWhitespaceConflicts bool
- AllowMerge bool
- AllowRebase bool
- AllowRebaseMerge bool
- AllowSquash bool
- AllowManualMerge bool
- AutodetectManualMerge bool
- DefaultMergeStyle MergeStyle
+ IgnoreWhitespaceConflicts bool
+ AllowMerge bool
+ AllowRebase bool
+ AllowRebaseMerge bool
+ AllowSquash bool
+ AllowManualMerge bool
+ AutodetectManualMerge bool
+ DefaultDeleteBranchAfterMerge bool
+ DefaultMergeStyle MergeStyle
}
// FromDB fills up a PullRequestsConfig from serialized format.