From c6ff7bfaecf537c7f0f3bf70a26b3b544a90205e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Rodr=C3=ADguez?= Date: Mon, 25 Jun 2018 19:49:55 -0400 Subject: Move git calls for `Repository#update_branch` inside Gitlab::Git This prepares this code for migration to Gitaly. --- lib/gitlab/git/repository.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index b3016c1a637..88944cd62ea 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -684,6 +684,10 @@ module Gitlab end end + def update_branch(branch_name, user:, newrev:, oldrev:) + OperationService.new(user, self).update_branch(branch_name, newrev, oldrev) + end + def rm_branch(branch_name, user:) gitaly_migrate(:operation_user_delete_branch, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| if is_enabled @@ -1953,8 +1957,7 @@ module Gitlab rebase_sha = run_git!(%w(rev-parse HEAD), chdir: rebase_path, env: env).strip - Gitlab::Git::OperationService.new(user, self) - .update_branch(branch, rebase_sha, branch_sha) + update_branch(branch, user: user, newrev: rebase_sha, oldrev: branch_sha) rebase_sha end -- cgit v1.2.1