Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'ruby')
-rw-r--r--ruby/lib/gitaly_server/operations_service.rb18
-rw-r--r--ruby/lib/gitlab/git/operation_service.rb5
-rw-r--r--ruby/lib/gitlab/git/repository.rb4
-rw-r--r--ruby/spec/lib/gitaly_server/sentry_interceptor_spec.rb4
4 files changed, 2 insertions, 29 deletions
diff --git a/ruby/lib/gitaly_server/operations_service.rb b/ruby/lib/gitaly_server/operations_service.rb
index e905828c4..af2318203 100644
--- a/ruby/lib/gitaly_server/operations_service.rb
+++ b/ruby/lib/gitaly_server/operations_service.rb
@@ -2,24 +2,6 @@ module GitalyServer
class OperationsService < Gitaly::OperationService::Service
include Utils
- def user_update_branch(request, call)
- repo = Gitlab::Git::Repository.from_gitaly(request.repository, call)
- branch_name = get_param!(request, :branch_name)
- newrev = get_param!(request, :newrev)
- oldrev = get_param!(request, :oldrev)
- gitaly_user = get_param!(request, :user)
- transaction = Praefect::Transaction.from_metadata(call.metadata)
-
- user = Gitlab::Git::User.from_gitaly(gitaly_user)
- repo.update_branch(branch_name, user: user, newrev: newrev, oldrev: oldrev, transaction: transaction)
-
- Gitaly::UserUpdateBranchResponse.new
- rescue Gitlab::Git::Repository::InvalidRef, Gitlab::Git::CommitError => ex
- raise GRPC::FailedPrecondition.new(ex.message)
- rescue Gitlab::Git::PreReceiveError => ex
- Gitaly::UserUpdateBranchResponse.new(pre_receive_error: set_utf8!(ex.message))
- end
-
# rubocop:disable Metrics/AbcSize
def user_rebase_confirmable(session, call)
Enumerator.new do |y|
diff --git a/ruby/lib/gitlab/git/operation_service.rb b/ruby/lib/gitlab/git/operation_service.rb
index 0ae429be0..b10ffeb44 100644
--- a/ruby/lib/gitlab/git/operation_service.rb
+++ b/ruby/lib/gitlab/git/operation_service.rb
@@ -56,11 +56,6 @@ module Gitlab
end
end
- def update_branch(branch_name, newrev, oldrev, push_options: nil, transaction: nil)
- ref = Gitlab::Git::BRANCH_REF_PREFIX + branch_name
- update_ref_in_hooks(ref, newrev, oldrev, push_options: push_options, transaction: transaction)
- end
-
# Yields the given block (which should return a commit) and
# writes it to the ref while also executing hooks for it.
# The ref is _always_ overwritten (nothing is taken from its
diff --git a/ruby/lib/gitlab/git/repository.rb b/ruby/lib/gitlab/git/repository.rb
index fa457cf92..fad18e5b2 100644
--- a/ruby/lib/gitlab/git/repository.rb
+++ b/ruby/lib/gitlab/git/repository.rb
@@ -205,10 +205,6 @@ module Gitlab
false
end
- def update_branch(branch_name, user:, newrev:, oldrev:, push_options: nil, transaction: nil)
- OperationService.new(user, self).update_branch(branch_name, newrev, oldrev, push_options: push_options, transaction: transaction)
- end
-
def diff_exists?(sha1, sha2)
rugged.diff(sha1, sha2).size.positive?
end
diff --git a/ruby/spec/lib/gitaly_server/sentry_interceptor_spec.rb b/ruby/spec/lib/gitaly_server/sentry_interceptor_spec.rb
index 4163c1cb7..3711a616c 100644
--- a/ruby/spec/lib/gitaly_server/sentry_interceptor_spec.rb
+++ b/ruby/spec/lib/gitaly_server/sentry_interceptor_spec.rb
@@ -45,7 +45,7 @@ describe GitalyServer::SentryInterceptor do
let(:expected_tags) do
call_metadata.merge(
'system' => 'gitaly-ruby',
- 'gitaly-ruby.method' => 'GitalyServer::OperationsService#user_update_branch',
+ 'gitaly-ruby.method' => 'Gitaly::OperationService::Service#user_update_branch',
Labkit::Correlation::CorrelationId::LOG_KEY => anything
)
end
@@ -68,7 +68,7 @@ describe GitalyServer::SentryInterceptor do
it 'sends the exception to Sentry' do
expect(Raven).to receive(:capture_exception).with(
ex,
- fingerprint: ['gitaly-ruby', 'GitalyServer::OperationsService#user_update_branch', 'unknown encoding']
+ fingerprint: ['gitaly-ruby', 'Gitaly::OperationService::Service#user_update_branch', 'unknown encoding']
)
begin