diff options
Diffstat (limited to 'lib/gitlab/gitaly_client')
-rw-r--r-- | lib/gitlab/gitaly_client/blob_service.rb | 8 | ||||
-rw-r--r-- | lib/gitlab/gitaly_client/remote_service.rb | 15 | ||||
-rw-r--r-- | lib/gitlab/gitaly_client/repository_service.rb | 11 |
3 files changed, 17 insertions, 17 deletions
diff --git a/lib/gitlab/gitaly_client/blob_service.rb b/lib/gitlab/gitaly_client/blob_service.rb index affd3986381..e4c8dc150a5 100644 --- a/lib/gitlab/gitaly_client/blob_service.rb +++ b/lib/gitlab/gitaly_client/blob_service.rb @@ -77,8 +77,8 @@ module Gitlab map_blob_types(response) end - def get_new_lfs_pointers(revision, limit, not_in, dynamic_timeout = nil) - request, rpc = create_new_lfs_pointers_request(revision, limit, not_in) + def get_new_lfs_pointers(revisions, limit, not_in, dynamic_timeout = nil) + request, rpc = create_new_lfs_pointers_request(revisions, limit, not_in) timeout = if dynamic_timeout @@ -109,7 +109,7 @@ module Gitlab private - def create_new_lfs_pointers_request(revision, limit, not_in) + def create_new_lfs_pointers_request(revisions, limit, not_in) # If the check happens for a change which is using a quarantine # environment for incoming objects, then we can avoid doing the # necessary graph walk to detect only new LFS pointers and instead scan @@ -126,7 +126,7 @@ module Gitlab [request, :list_all_lfs_pointers] else - revisions = [revision] + revisions = Array.wrap(revisions) revisions += if not_in.nil? || not_in == :all ["--not", "--all"] else diff --git a/lib/gitlab/gitaly_client/remote_service.rb b/lib/gitlab/gitaly_client/remote_service.rb index 04dd394a2bd..1f360385111 100644 --- a/lib/gitlab/gitaly_client/remote_service.rb +++ b/lib/gitlab/gitaly_client/remote_service.rb @@ -45,18 +45,9 @@ module Gitlab # The remote_name parameter is deprecated and will be removed soon. def find_remote_root_ref(remote_name, remote_url, authorization) - request = if Feature.enabled?(:find_remote_root_refs_inmemory, default_enabled: :yaml) - Gitaly::FindRemoteRootRefRequest.new( - repository: @gitaly_repo, - remote_url: remote_url, - http_authorization_header: authorization - ) - else - Gitaly::FindRemoteRootRefRequest.new( - repository: @gitaly_repo, - remote: remote_name - ) - end + request = Gitaly::FindRemoteRootRefRequest.new(repository: @gitaly_repo, + remote_url: remote_url, + http_authorization_header: authorization) response = GitalyClient.call(@storage, :remote_service, :find_remote_root_ref, request, timeout: GitalyClient.medium_timeout) diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb index d2dbd456180..6a75096ff80 100644 --- a/lib/gitlab/gitaly_client/repository_service.rb +++ b/lib/gitlab/gitaly_client/repository_service.rb @@ -70,13 +70,21 @@ module Gitlab end.join end - def fetch_remote(remote, ssh_auth:, forced:, no_tags:, timeout:, prune: true, check_tags_changed: false) + # rubocop: disable Metrics/ParameterLists + # The `remote` parameter is going away soonish anyway, at which point the + # Rubocop warning can be enabled again. + def fetch_remote(remote, url:, refmap:, ssh_auth:, forced:, no_tags:, timeout:, prune: true, check_tags_changed: false) request = Gitaly::FetchRemoteRequest.new( repository: @gitaly_repo, remote: remote, force: forced, no_tags: no_tags, timeout: timeout, no_prune: !prune, check_tags_changed: check_tags_changed ) + if url + request.remote_params = Gitaly::Remote.new(url: url, + mirror_refmaps: Array.wrap(refmap).map(&:to_s)) + end + if ssh_auth&.ssh_mirror_url? if ssh_auth.ssh_key_auth? && ssh_auth.ssh_private_key.present? request.ssh_key = ssh_auth.ssh_private_key @@ -89,6 +97,7 @@ module Gitlab GitalyClient.call(@storage, :repository_service, :fetch_remote, request, timeout: GitalyClient.long_timeout) end + # rubocop: enable Metrics/ParameterLists def create_repository request = Gitaly::CreateRepositoryRequest.new(repository: @gitaly_repo) |