summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Rodríguez <alejorro70@gmail.com>2018-06-25 19:49:55 -0400
committerAlejandro Rodríguez <alejorro70@gmail.com>2018-06-25 19:49:55 -0400
commitc6ff7bfaecf537c7f0f3bf70a26b3b544a90205e (patch)
tree8b21e5e507fa5d5e6960ea7c24020ba25c74721f
parentdd949b0be4b2187d01a05ea1ce32abc295077897 (diff)
downloadgitlab-ce-ce-update-branch-client-preparation.tar.gz
Move git calls for `Repository#update_branch` inside Gitlab::Gitce-update-branch-client-preparation
This prepares this code for migration to Gitaly.
-rw-r--r--lib/gitlab/git/repository.rb7
1 files 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