Commit 6eeff4cd authored by micael.bergeron's avatar micael.bergeron

fix the merger override to remove source branch

parent 845b2f1a
Pipeline #12698718 passed with stages
in 99 minutes and 34 seconds
......@@ -60,13 +60,11 @@ module MergeRequests
def after_merge, current_user).execute(merge_request)
if params[:should_remove_source_branch].present? || @merge_request.force_remove_source_branch?
if delete_source_branch?
# Verify again that the source branch can be removed, since branch may be protected,
# or the source branch may have been updated.
if @merge_request.can_remove_source_branch?(branch_deletion_user), branch_deletion_user)
end, branch_deletion_user)
......@@ -78,6 +76,11 @@ module MergeRequests
@merge_request.force_remove_source_branch? ? : current_user
def delete_source_branch?
params.fetch('should_remove_source_branch', @merge_request.force_remove_source_branch?) &&
# Logs merge error message and cleans `MergeRequest#merge_jid`.
def handle_merge_error(log_message:, save_message_on_model: false)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment