Commit 0a3548df authored by Robert Speicher's avatar Robert Speicher

Pass keep_divergent_refs in RemoteMirror#update_repository

parent d926e01b
...@@ -117,6 +117,8 @@ class RemoteMirror < ApplicationRecord ...@@ -117,6 +117,8 @@ class RemoteMirror < ApplicationRecord
end end
end end
options[:keep_divergent_refs] = keep_divergent_refs?
Gitlab::Git::RemoteMirror.new( Gitlab::Git::RemoteMirror.new(
project.repository.raw, project.repository.raw,
remote_name, remote_name,
......
...@@ -142,6 +142,26 @@ describe RemoteMirror, :mailer do ...@@ -142,6 +142,26 @@ describe RemoteMirror, :mailer do
end end
end end
describe '#update_repository' do
let(:git_remote_mirror) { spy }
before do
stub_const('Gitlab::Git::RemoteMirror', git_remote_mirror)
end
it 'includes the `keep_divergent_refs` setting' do
mirror = build_stubbed(:remote_mirror, keep_divergent_refs: true)
mirror.update_repository({})
expect(git_remote_mirror).to have_received(:new).with(
anything,
mirror.remote_name,
hash_including(keep_divergent_refs: true)
)
end
end
describe '#safe_url' do describe '#safe_url' do
context 'when URL contains credentials' do context 'when URL contains credentials' do
it 'masks the credentials' do it 'masks the credentials' do
......
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