feat(api): let a merge delete the source branch
- commit
- e9394b717bc2afe3b4ef998d8c4df50aca16bc6a
- author
- brice · · 2026-10-11 05:29 UTC
- parent
- 303f037
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +45 -9
M gen/ermite/merge_request.pb.go +35 -9 generated file: collapsed
M proto/ermite/merge_request.proto +10 -0
| @@ -345,6 +345,12 @@ message MergeMergeRequestRequest { | |||
| 345 | 345 | // MergeRequest.head_id it was shown. Required. The merge happens only if the | |
| 346 | 346 | // source branch still points to it. | |
| 347 | 347 | string head_id = 4; | |
| 348 | + | // DeleteSourceBranch deletes the source branch after the merge. The merge | |
| 349 | + | // is refused before anything changes when the source branch is the default | |
| 350 | + | // branch of the repository or the source or target of another open merge | |
| 351 | + | // request. Servers without the "merge_requests.delete_branch" feature ignore | |
| 352 | + | // it. | |
| 353 | + | bool delete_source_branch = 5; | |
| 348 | 354 | } | |
| 349 | 355 | ||
| 350 | 356 | // MergeMergeRequestResponse holds the merged merge request. | |
| @@ -353,6 +359,10 @@ message MergeMergeRequestResponse { | |||
| 353 | 359 | // merged_commit_id set to the new tip of the target branch and merge_mode | |
| 354 | 360 | // set to the mode used. | |
| 355 | 361 | MergeRequest merge_request = 1; | |
| 362 | + | // SourceBranchDeleted is true when delete_source_branch was set and the | |
| 363 | + | // branch is gone. It is false when the deletion failed after the merge (the | |
| 364 | + | // branch moved in between, say): the merge stands and the branch is kept. | |
| 365 | + | bool source_branch_deleted = 2; | |
| 356 | 366 | } | |
| 357 | 367 | ||
| 358 | 368 | // MarkReadRequest records a read position. | |
| @@ -345,6 +345,12 @@ message MergeMergeRequestRequest { | |||||
| 345 | // MergeRequest.head_id it was shown. Required. The merge happens only if the | 345 | // MergeRequest.head_id it was shown. Required. The merge happens only if the | ||
| 346 | // source branch still points to it. | 346 | // source branch still points to it. | ||
| 347 | string head_id = 4; | 347 | string head_id = 4; | ||
| 348 | + | // DeleteSourceBranch deletes the source branch after the merge. The merge | |||
| 349 | + | // is refused before anything changes when the source branch is the default | |||
| 350 | + | // branch of the repository or the source or target of another open merge | |||
| 351 | + | // request. Servers without the "merge_requests.delete_branch" feature ignore | |||
| 352 | + | // it. | |||
| 353 | + | bool delete_source_branch = 5; | |||
| 348 | } | 354 | } | ||
| 349 | 355 | ||||
| 350 | // MergeMergeRequestResponse holds the merged merge request. | 356 | // MergeMergeRequestResponse holds the merged merge request. | ||
| @@ -353,6 +359,10 @@ message MergeMergeRequestResponse { | |||||
| 353 | // merged_commit_id set to the new tip of the target branch and merge_mode | 359 | // merged_commit_id set to the new tip of the target branch and merge_mode | ||
| 354 | // set to the mode used. | 360 | // set to the mode used. | ||
| 355 | MergeRequest merge_request = 1; | 361 | MergeRequest merge_request = 1; | ||
| 362 | + | // SourceBranchDeleted is true when delete_source_branch was set and the | |||
| 363 | + | // branch is gone. It is false when the deletion failed after the merge (the | |||
| 364 | + | // branch moved in between, say): the merge stands and the branch is kept. | |||
| 365 | + | bool source_branch_deleted = 2; | |||
| 356 | } | 366 | } | ||
| 357 | 367 | ||||
| 358 | // MarkReadRequest records a read position. | 368 | // MarkReadRequest records a read position. | ||