Commit 9df78bc4 authored by Lin Jen-Shin's avatar Lin Jen-Shin
parent 76115e2e
......@@ -13,7 +13,7 @@ module MergeRequests
source,
merge_request.target_branch,
merge_request: merge_request)
rescue GitHooksService::PreReceiveError => e
rescue Gitlab::Git::HooksService::PreReceiveError => e
raise MergeError, e.message
rescue StandardError => e
raise MergeError, "Something went wrong during merge: #{e.message}"
......
......@@ -50,7 +50,7 @@ module Projects
else
begin
repository.ff_merge(current_user, upstream_branch.dereferenced_target, name)
rescue GitHooksService::PreReceiveError, Repository::CommitError => e
rescue Gitlab::Git::HooksService::PreReceiveError, Repository::CommitError => e
errors << e.message
end
end
......
......@@ -71,7 +71,7 @@ describe MergeRequests::FfMergeService do
it 'logs and saves error if there is an PreReceiveError exception' do
error_message = 'error message'
allow(service).to receive(:repository).and_raise(GitHooksService::PreReceiveError, error_message)
allow(service).to receive(:repository).and_raise(Gitlab::Git::HooksService::PreReceiveError, error_message)
allow(service).to receive(:execute_hooks)
service.execute(merge_request)
......
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