diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-15 18:07:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-15 18:07:42 +0300 |
commit | fa7c331b76ed59230cc56fc51bfc9e467c8bb9b4 (patch) | |
tree | eb03d2b6e8dd45f67864635c8b0b0de8d671edf7 /lib/gitlab/gitaly_client | |
parent | f26f31d2fd8e3c91677e2629293b9e0562c1437a (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/gitaly_client')
-rw-r--r-- | lib/gitlab/gitaly_client/operation_service.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/gitlab/gitaly_client/operation_service.rb b/lib/gitlab/gitaly_client/operation_service.rb index 6865e76d4bb..313334737c0 100644 --- a/lib/gitlab/gitaly_client/operation_service.rb +++ b/lib/gitlab/gitaly_client/operation_service.rb @@ -152,7 +152,7 @@ module Gitlab response.commit_id end - def user_merge_branch(user, source_sha, target_branch, message) + def user_merge_branch(user, source_sha:, target_branch:, message:, target_sha: nil) request_enum = QueueEnumerator.new response_enum = gitaly_client_call( @repository.storage, @@ -168,6 +168,7 @@ module Gitlab user: Gitlab::Git::User.from_gitlab(user).to_gitaly, commit_id: source_sha, branch: encode_binary(target_branch), + expected_old_oid: target_sha, message: encode_binary(message), timestamp: Google::Protobuf::Timestamp.new(seconds: Time.now.utc.to_i) ) @@ -184,7 +185,6 @@ module Gitlab raise Gitlab::Git::CommitError, 'failed to apply merge to branch' unless branch_update.commit_id.present? Gitlab::Git::OperationService::BranchUpdate.from_gitaly(branch_update) - rescue GRPC::BadStatus => e detailed_error = GitalyClient.decode_detailed_error(e) @@ -207,12 +207,13 @@ module Gitlab request_enum.close end - def user_ff_branch(user, source_sha, target_branch) + def user_ff_branch(user, source_sha:, target_branch:, target_sha: nil) request = Gitaly::UserFFBranchRequest.new( repository: @gitaly_repo, user: Gitlab::Git::User.from_gitlab(user).to_gitaly, commit_id: source_sha, - branch: encode_binary(target_branch) + branch: encode_binary(target_branch), + expected_old_oid: target_sha ) response = gitaly_client_call( |