diff options
-rw-r--r-- | app/services/merge_requests/merge_service.rb | 3 | ||||
-rw-r--r-- | changelogs/unreleased/sh-show-pre-receive-error-merge.yml | 5 | ||||
-rw-r--r-- | spec/services/merge_requests/merge_service_spec.rb | 2 |
3 files changed, 3 insertions, 7 deletions
diff --git a/app/services/merge_requests/merge_service.rb b/app/services/merge_requests/merge_service.rb index b29e0b1759e..8241e408ce5 100644 --- a/app/services/merge_requests/merge_service.rb +++ b/app/services/merge_requests/merge_service.rb @@ -76,7 +76,8 @@ module MergeRequests def try_merge repository.merge(current_user, source, merge_request, commit_message) 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 handle_merge_error(log_message: e.message) raise_error('Something went wrong during merge') diff --git a/changelogs/unreleased/sh-show-pre-receive-error-merge.yml b/changelogs/unreleased/sh-show-pre-receive-error-merge.yml deleted file mode 100644 index 5e662b34773..00000000000 --- a/changelogs/unreleased/sh-show-pre-receive-error-merge.yml +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Show pre-receive error message when merge fails -merge_request: 25708 -author: -type: fixed diff --git a/spec/services/merge_requests/merge_service_spec.rb b/spec/services/merge_requests/merge_service_spec.rb index 9d674263259..ede79b87bcc 100644 --- a/spec/services/merge_requests/merge_service_spec.rb +++ b/spec/services/merge_requests/merge_service_spec.rb @@ -244,7 +244,7 @@ describe MergeRequests::MergeService do 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)) end |