Commit 1711a384 authored by Douwe Maan's avatar Douwe Maan Committed by Fatih Acet
Browse files

Prevent “This merge request contains merge conflicts” from being shown after...

Prevent “This merge request contains merge conflicts” from being shown after resolution because of slow background workers
parent 03ffe1b7b653
......@@ -53,7 +53,7 @@
return function(data) {
var callback, urlSuffix;
if (data.state === "merged") {
urlSuffix = deleteSourceBranch ? '?delete_source=true' : '';
urlSuffix = deleteSourceBranch ? '?deleted_source_branch=true' : '';
return window.location.href = window.location.pathname + urlSuffix;
} else if (data.merge_error) {
return $('.mr-widget-body').html("<h4>" + data.merge_error + "</h4>");
......
......@@ -168,7 +168,7 @@ def resolve_conflicts
flash[:conflicts_message] = 'Merge conflicts resolved.'
flash.keep
render json: { redirect_to: namespace_project_merge_request_url(@project.namespace, @project, @merge_request) }
render json: { redirect_to: namespace_project_merge_request_url(@project.namespace, @project, @merge_request, resolved_conflicts: true) }
rescue Gitlab::Conflict::File::MissingResolution => e
render status: :bad_request, json: { message: e.message }
end
......
......@@ -6,7 +6,7 @@
- if @merge_request.merge_event
by #{link_to_member(@project, @merge_request.merge_event.author, avatar: true)}
#{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
- if !@merge_request.source_branch_exists? || (params[:delete_source] == 'true')
- if !@merge_request.source_branch_exists? || params[:deleted_source_branch]
%p
The changes were merged into
#{link_to @merge_request.target_branch, namespace_project_commits_path(@project.namespace, @project, @merge_request.target_branch), class: "label-branch"}.
......
......@@ -9,7 +9,7 @@
= render 'projects/merge_requests/widget/open/missing_branch'
- elsif @merge_request.unchecked?
= render 'projects/merge_requests/widget/open/check'
- elsif @merge_request.cannot_be_merged?
- elsif @merge_request.cannot_be_merged? && !params[:resolved_conflicts]
= render 'projects/merge_requests/widget/open/conflicts'
- elsif @merge_request.work_in_progress?
= render 'projects/merge_requests/widget/open/wip'
......
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