Commit ed4b0f7a authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 69735dda aa7c927e
......@@ -23,13 +23,6 @@ module Gitlab
end
def link(to_link_repo)
remote_name = to_link_repo.object_pool_remote_name
repository.set_config(
"remote.#{remote_name}.url" => relative_path_to(to_link_repo.relative_path),
"remote.#{remote_name}.tagOpt" => "--no-tags",
"remote.#{remote_name}.fetch" => "+refs/*:refs/remotes/#{remote_name}/*"
)
object_pool_service.link_repository(to_link_repo)
end
......
......@@ -56,16 +56,11 @@ describe Gitlab::Git::ObjectPool do
describe '#link' do
let!(:pool_repository) { create(:pool_repository, :ready) }
context 'when no remotes are set' do
context 'when linked for the first time' do
it 'sets a remote' do
subject.link(source_repository)
repo = Gitlab::GitalyClient::StorageSettings.allow_disk_access do
Rugged::Repository.new(subject.repository.path)
end
expect(repo.remotes.count).to be(1)
expect(repo.remotes.first.name).to eq(source_repository.object_pool_remote_name)
expect do
subject.link(source_repository)
end.not_to raise_error
end
end
......@@ -75,14 +70,9 @@ describe Gitlab::Git::ObjectPool do
end
it "doesn't raise an error" do
subject.link(source_repository)
repo = Gitlab::GitalyClient::StorageSettings.allow_disk_access do
Rugged::Repository.new(subject.repository.path)
end
expect(repo.remotes.count).to be(1)
expect(repo.remotes.first.name).to eq(source_repository.object_pool_remote_name)
expect do
subject.link(source_repository)
end.not_to raise_error
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