Commit 1b4a20c0 authored by Stan Hu's avatar Stan Hu

Merge branch 'revert-1c706c68' into 'master'

Revert "Merge branch 'sh-show-pre-receive-error-merge' into 'master'"

See merge request gitlab-org/gitlab-ce!25895
parents 1de36fd2 33205b08
...@@ -76,7 +76,8 @@ module MergeRequests ...@@ -76,7 +76,8 @@ module MergeRequests
def try_merge def try_merge
repository.merge(current_user, source, merge_request, commit_message) repository.merge(current_user, source, merge_request, commit_message)
rescue Gitlab::Git::PreReceiveError => e rescue Gitlab::Git::PreReceiveError => e
raise_error("Something went wrong during merge pre-receive hook: #{e.message}") handle_merge_error(log_message: e.message)
raise_error('Something went wrong during merge pre-receive hook')
rescue => e rescue => e
handle_merge_error(log_message: e.message) handle_merge_error(log_message: e.message)
raise_error('Something went wrong during merge') raise_error('Something went wrong during merge')
......
---
title: Show pre-receive error message when merge fails
merge_request: 25708
author:
type: fixed
...@@ -244,7 +244,7 @@ describe MergeRequests::MergeService do ...@@ -244,7 +244,7 @@ describe MergeRequests::MergeService do
service.execute(merge_request) service.execute(merge_request)
expect(merge_request.merge_error).to include("Something went wrong during merge pre-receive hook: #{error_message}") expect(merge_request.merge_error).to include('Something went wrong during merge pre-receive hook')
expect(Rails.logger).to have_received(:error).with(a_string_matching(error_message)) expect(Rails.logger).to have_received(:error).with(a_string_matching(error_message))
end end
......
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