diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2018-01-29 18:11:16 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2018-01-31 01:51:56 +0300 |
commit | 5aeb5ff51e8d25791c400301a627932e2f4091e8 (patch) | |
tree | 681592a76c8e877bb18018cd0461961ce2ea7ab2 /lib | |
parent | a74413980bd9fa2a9b5dd8dbee8307f14063fbcb (diff) |
Add support for PreReceiveError in UserMergeBranch RPC
Closes gitaly#979
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/gitaly_client/operation_service.rb | 8 |
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? |