• Stan Hu's avatar
    Fix force_remove_source_branch not working in API · e175d2a1
    Stan Hu authored
    When an MR is merged via the API without `should_remove_source_branch`
    set, the branch is always retained, even if `force_remove_source_branch`
    is set to true in the MR merge params. This was happening because the
    API always passed a `should_remove_source_branch` with a `nil` value,
    and `MergeService` interpreted this as `false`.
    
    To fix this, we strip `nil` values from the `merge_params`.
    
    Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/219991
    e175d2a1
merge_requests.rb 21.8 KB