diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-05-16 14:15:15 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-05-16 14:15:15 +0300 |
commit | f05ff2d93d111c39613a2c928dc1dc809d7e2c5d (patch) | |
tree | fa9bb40785a063b31856e9dd5e18e656610f0832 /lib/gitlab | |
parent | 75f94fc39bedbc635bd4bc52cdf145d1e81752dd (diff) | |
parent | e012485a99d83cc57a46b17eb50b9e360dbb51c9 (diff) |
Merge branch 'zj-add-branch-mandatory' into 'master'
Move Gitlab::Git::Repository#add_branch to mandatory
Closes gitaly#540
See merge request gitlab-org/gitlab-ce!18939
Diffstat (limited to 'lib/gitlab')
-rw-r--r-- | lib/gitlab/git/repository.rb | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 25487f53999..061865a7acf 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -776,13 +776,9 @@ module Gitlab end def add_branch(branch_name, user:, target:) - gitaly_migrate(:operation_user_create_branch, status: Gitlab::GitalyClient::MigrationStatus::OPT_OUT) do |is_enabled| - if is_enabled - gitaly_add_branch(branch_name, user, target) - else - rugged_add_branch(branch_name, user, target) - end - end + gitaly_operation_client.user_create_branch(branch_name, user, target) + rescue GRPC::FailedPrecondition => ex + raise InvalidRef, ex end def add_tag(tag_name, user:, target:, message: nil) @@ -2197,22 +2193,6 @@ module Gitlab end end - def gitaly_add_branch(branch_name, user, target) - gitaly_operation_client.user_create_branch(branch_name, user, target) - rescue GRPC::FailedPrecondition => ex - raise InvalidRef, ex - end - - def rugged_add_branch(branch_name, user, target) - target_object = Ref.dereference_object(lookup(target)) - raise InvalidRef.new("target not found: #{target}") unless target_object - - OperationService.new(user, self).add_branch(branch_name, target_object.oid) - find_branch(branch_name) - rescue Rugged::ReferenceError => ex - raise InvalidRef, ex - end - def rugged_cherry_pick(user:, commit:, branch_name:, message:, start_branch_name:, start_repository:) OperationService.new(user, self).with_branch( branch_name, |