diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2018-01-29 16:11:16 +0100 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2018-01-30 23:51:56 +0100 |
commit | 5aeb5ff51e8d25791c400301a627932e2f4091e8 (patch) | |
tree | 681592a76c8e877bb18018cd0461961ce2ea7ab2 /lib | |
parent | a74413980bd9fa2a9b5dd8dbee8307f14063fbcb (diff) | |
download | gitlab-ce-5aeb5ff51e8d25791c400301a627932e2f4091e8.tar.gz |
Add support for PreReceiveError in UserMergeBranch RPCfix/add-support-for-pre-receive-error-in-merge-branch
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? |