Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2018-01-29 18:11:16 +0300
committerAhmad Sherif <me@ahmadsherif.com>2018-01-31 01:51:56 +0300
commit5aeb5ff51e8d25791c400301a627932e2f4091e8 (patch)
tree681592a76c8e877bb18018cd0461961ce2ea7ab2 /lib
parenta74413980bd9fa2a9b5dd8dbee8307f14063fbcb (diff)
Add support for PreReceiveError in UserMergeBranch RPC
Closes gitaly#979
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/gitaly_client/operation_service.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/gitlab/gitaly_client/operation_service.rb b/lib/gitlab/gitaly_client/operation_service.rb
index c2b4155e6a5..cd2734b5a07 100644
--- a/lib/gitlab/gitaly_client/operation_service.rb
+++ b/lib/gitlab/gitaly_client/operation_service.rb
@@ -103,7 +103,13 @@ module Gitlab
request_enum.push(Gitaly::UserMergeBranchRequest.new(apply: true))
- branch_update = response_enum.next.branch_update
+ second_response = response_enum.next
+
+ if second_response.pre_receive_error.present?
+ raise Gitlab::Git::HooksService::PreReceiveError, second_response.pre_receive_error
+ end
+
+ branch_update = second_response.branch_update
return if branch_update.nil?
raise Gitlab::Git::CommitError.new('failed to apply merge to branch') unless branch_update.commit_id.present?