Commit 3c0e3b8a authored by Robert Speicher's avatar Robert Speicher

Add keep_divergent_refs to GitalyClient::RemoteService

The option defaults to false to match existing behavior.
parent fcc03152
...@@ -53,7 +53,7 @@ module Gitlab ...@@ -53,7 +53,7 @@ module Gitlab
encode_utf8(response.ref) encode_utf8(response.ref)
end end
def update_remote_mirror(ref_name, only_branches_matching, ssh_key: nil, known_hosts: nil) def update_remote_mirror(ref_name, only_branches_matching, ssh_key: nil, known_hosts: nil, keep_divergent_refs: false)
req_enum = Enumerator.new do |y| req_enum = Enumerator.new do |y|
first_request = Gitaly::UpdateRemoteMirrorRequest.new( first_request = Gitaly::UpdateRemoteMirrorRequest.new(
repository: @gitaly_repo, repository: @gitaly_repo,
...@@ -62,6 +62,7 @@ module Gitlab ...@@ -62,6 +62,7 @@ module Gitlab
first_request.ssh_key = ssh_key if ssh_key.present? first_request.ssh_key = ssh_key if ssh_key.present?
first_request.known_hosts = known_hosts if known_hosts.present? first_request.known_hosts = known_hosts if known_hosts.present?
first_request.keep_divergent_refs = keep_divergent_refs
y.yield(first_request) y.yield(first_request)
......
...@@ -66,7 +66,7 @@ describe Gitlab::GitalyClient::RemoteService do ...@@ -66,7 +66,7 @@ describe Gitlab::GitalyClient::RemoteService do
.with(kind_of(Enumerator), kind_of(Hash)) .with(kind_of(Enumerator), kind_of(Hash))
.and_return(double(:update_remote_mirror_response)) .and_return(double(:update_remote_mirror_response))
client.update_remote_mirror(ref_name, only_branches_matching, ssh_key: ssh_key, known_hosts: known_hosts) client.update_remote_mirror(ref_name, only_branches_matching, ssh_key: ssh_key, known_hosts: known_hosts, keep_divergent_refs: true)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment