diff options
Diffstat (limited to 'lib/gitlab/gitaly_client/repository_service.rb')
-rw-r--r-- | lib/gitlab/gitaly_client/repository_service.rb | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb index 009aeaf868a..2e26b3341a2 100644 --- a/lib/gitlab/gitaly_client/repository_service.rb +++ b/lib/gitlab/gitaly_client/repository_service.rb @@ -73,18 +73,21 @@ module Gitlab # 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) + def fetch_remote(url, refmap:, ssh_auth:, forced:, no_tags:, timeout:, prune: true, check_tags_changed: false, http_authorization_header: "") 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 + repository: @gitaly_repo, + force: forced, + no_tags: no_tags, + timeout: timeout, + no_prune: !prune, + check_tags_changed: check_tags_changed, + remote_params: Gitaly::Remote.new( + url: url, + mirror_refmaps: Array.wrap(refmap).map(&:to_s), + http_authorization_header: http_authorization_header + ) ) - 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 @@ -263,34 +266,33 @@ module Gitlab GitalyClient.call(@storage, :repository_service, :write_ref, request, timeout: GitalyClient.fast_timeout) end - def set_config(entries) - return if entries.empty? - - request = Gitaly::SetConfigRequest.new(repository: @gitaly_repo) - entries.each do |key, value| - request.entries << build_set_config_entry(key, value) - end - + def set_full_path(path) GitalyClient.call( @storage, :repository_service, - :set_config, - request, + :set_full_path, + Gitaly::SetFullPathRequest.new( + repository: @gitaly_repo, + path: path + ), timeout: GitalyClient.fast_timeout ) nil end - def delete_config(keys) - return if keys.empty? + def set_config(entries) + return if entries.empty? - request = Gitaly::DeleteConfigRequest.new(repository: @gitaly_repo, keys: keys) + request = Gitaly::SetConfigRequest.new(repository: @gitaly_repo) + entries.each do |key, value| + request.entries << build_set_config_entry(key, value) + end GitalyClient.call( @storage, :repository_service, - :delete_config, + :set_config, request, timeout: GitalyClient.fast_timeout ) |