diff options
Diffstat (limited to 'lib/gitlab/gitaly_client/remote_service.rb')
-rw-r--r-- | lib/gitlab/gitaly_client/remote_service.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/gitlab/gitaly_client/remote_service.rb b/lib/gitlab/gitaly_client/remote_service.rb index 1f360385111..487127b7b74 100644 --- a/lib/gitlab/gitaly_client/remote_service.rb +++ b/lib/gitlab/gitaly_client/remote_service.rb @@ -55,13 +55,18 @@ module Gitlab encode_utf8(response.ref) end - def update_remote_mirror(ref_name, only_branches_matching, ssh_key: nil, known_hosts: nil, keep_divergent_refs: false) + def update_remote_mirror(ref_name, remote_url, only_branches_matching, ssh_key: nil, known_hosts: nil, keep_divergent_refs: false) req_enum = Enumerator.new do |y| first_request = Gitaly::UpdateRemoteMirrorRequest.new( - repository: @gitaly_repo, - ref_name: ref_name + repository: @gitaly_repo ) + if remote_url + first_request.remote = Gitaly::UpdateRemoteMirrorRequest::Remote.new(url: remote_url) + else + first_request.ref_name = ref_name + end + first_request.ssh_key = ssh_key if ssh_key.present? first_request.known_hosts = known_hosts if known_hosts.present? first_request.keep_divergent_refs = keep_divergent_refs |