]> source.dussan.org Git - gitea.git/commit
Add checkbox to delete pull branch after successful merge (#16049)
authorJimmy Praet <jimmy.praet@telenet.be>
Mon, 12 Jul 2021 23:26:25 +0000 (01:26 +0200)
committerGitHub <noreply@github.com>
Mon, 12 Jul 2021 23:26:25 +0000 (01:26 +0200)
commit78118a3b029ee4eb140d47be22e86df17253a786
tree81aaa17946b3bd8086cdb6e23ca4349dea118f50
parent46a4c6835daf4642074bb1a18a3210b03a64259b
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>
14 files changed:
models/repo_unit.go
modules/structs/repo.go
options/locale/locale_en-US.ini
routers/api/v1/repo/pull.go
routers/api/v1/repo/repo.go
routers/web/repo/pull.go
routers/web/repo/setting.go
services/forms/repo_form.go
services/pull/pull.go
services/pull/temp_repo.go
services/pull/update.go
templates/repo/issue/view_content/pull.tmpl
templates/repo/settings/options.tmpl
templates/swagger/v1_json.tmpl