summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-03-07 23:15:47 +0000
committerStan Hu <stanhu@gmail.com>2019-03-07 23:15:47 +0000
commit1b4a20c02ea16eb6e8250636c0c0a6a6464a007b (patch)
tree96e6d3d293812d59876780bc9e7b1f42a03a9070
parent1de36fd2eef900a93606e1c0558f736ad88717cd (diff)
parent33205b08c9a425c8338a8292fa0b389db355c7a6 (diff)
downloadgitlab-ce-1b4a20c02ea16eb6e8250636c0c0a6a6464a007b.tar.gz
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
-rw-r--r--app/services/merge_requests/merge_service.rb3
-rw-r--r--changelogs/unreleased/sh-show-pre-receive-error-merge.yml5
-rw-r--r--spec/services/merge_requests/merge_service_spec.rb2
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