Skip to content

Fix should_remove_source_branch

What does this MR do and why?

should_remove_source_branch is an information from a Merge Request which has a meaningful value once the merge request is merged. It is used to check if the source branch should have been removed. Its value was not properly updated when a MR is merged.

When a Merger is merging a MR using the GUI should_remove_source_branch is defined: the option box is ticked or not.
delete_souce_branch

When the API is used to merge a MR, if should_remove_source_branch is given as a parameter it takes over
General->Merge Requests->Merge options->Enable "Delete source branch" option by default
config_general_mr_option
which is named force_remove_source_branch when looking at the MR information


After this MR is merged, looking at should_remove_source_branch and force_remove_source_branch for a merged MR will show if the source branch should have been removed according to this table.

should_remove_source_branch force_remove_source_branch source branch should have been removed
true x true
false x false
null true true
null false false

Screenshots or screen recordings

These are strongly recommended to assist reviewers and reduce the time to merge your change.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Guillaume CHAUVEL

Merge request reports