MR force_remove_source_branch flag not respected on API merge
When an MR is merged via the API without should_remove_source_branch
set (which the documentation claims is optional), the branch is always retained, even if force_remove_source_branch
is set to true in the MR merge params.
This seems incorrect, and is certainly surprising. It looks like when the parameter is not provided, https://gitlab.com/gitlab-org/gitlab/blob/master/app/services/merge_requests/merge_service.rb#L118 is finding an actual value for should_remove_source_branch
in the params (a HashWithIndifferentAccess) that is non-true (empty?) thus it doesn't fall back to the force remove field.