Commit 8e699fe9 authored by James Fargher's avatar James Fargher

Remove FetchInternalRemote Gitaly RPC

Cleans out now unused RPC code
parent 1b4e1fa8
...@@ -773,12 +773,6 @@ module Gitlab ...@@ -773,12 +773,6 @@ module Gitlab
!has_visible_content? !has_visible_content?
end end
def fetch_repository_as_mirror(repository)
wrapped_gitaly_errors do
gitaly_remote_client.fetch_internal_remote(repository)
end
end
# Fetch remote for repository # Fetch remote for repository
# #
# remote - remote name # remote - remote name
......
...@@ -41,20 +41,6 @@ module Gitlab ...@@ -41,20 +41,6 @@ module Gitlab
GitalyClient.call(@storage, :remote_service, :remove_remote, request, timeout: GitalyClient.long_timeout).result GitalyClient.call(@storage, :remote_service, :remove_remote, request, timeout: GitalyClient.long_timeout).result
end end
def fetch_internal_remote(repository)
request = Gitaly::FetchInternalRemoteRequest.new(
repository: @gitaly_repo,
remote_repository: repository.gitaly_repository
)
response = GitalyClient.call(@storage, :remote_service,
:fetch_internal_remote, request,
timeout: GitalyClient.long_timeout,
remote_storage: repository.storage)
response.result
end
def find_remote_root_ref(remote_name) def find_remote_root_ref(remote_name)
request = Gitaly::FindRemoteRootRefRequest.new( request = Gitaly::FindRemoteRootRefRequest.new(
repository: @gitaly_repo, repository: @gitaly_repo,
......
...@@ -492,50 +492,6 @@ describe Gitlab::Git::Repository, :seed_helper do ...@@ -492,50 +492,6 @@ describe Gitlab::Git::Repository, :seed_helper do
end end
end end
describe '#fetch_repository_as_mirror' do
let(:new_repository) do
Gitlab::Git::Repository.new('default', 'my_project.git', '', 'group/project')
end
subject { new_repository.fetch_repository_as_mirror(repository) }
before do
new_repository.create_repository
end
after do
new_repository.remove
end
it 'fetches a repository as a mirror remote' do
subject
expect(refs(new_repository_path)).to eq(refs(repository_path))
end
context 'with keep-around refs' do
let(:sha) { SeedRepo::Commit::ID }
let(:keep_around_ref) { "refs/keep-around/#{sha}" }
let(:tmp_ref) { "refs/tmp/#{SecureRandom.hex}" }
before do
repository_rugged.references.create(keep_around_ref, sha, force: true)
repository_rugged.references.create(tmp_ref, sha, force: true)
end
it 'includes the temporary and keep-around refs' do
subject
expect(refs(new_repository_path)).to include(keep_around_ref)
expect(refs(new_repository_path)).to include(tmp_ref)
end
end
def new_repository_path
File.join(TestEnv.repos_path, new_repository.relative_path)
end
end
describe '#fetch_remote' do describe '#fetch_remote' do
it 'delegates to the gitaly RepositoryService' do it 'delegates to the gitaly RepositoryService' do
ssh_auth = double(:ssh_auth) ssh_auth = double(:ssh_auth)
......
...@@ -34,19 +34,6 @@ describe Gitlab::GitalyClient::RemoteService do ...@@ -34,19 +34,6 @@ describe Gitlab::GitalyClient::RemoteService do
end end
end end
describe '#fetch_internal_remote' do
let(:remote_repository) { Gitlab::Git::Repository.new('default', TEST_MUTABLE_REPO_PATH, '', 'group/project') }
it 'sends an fetch_internal_remote message and returns the result value' do
expect_any_instance_of(Gitaly::RemoteService::Stub)
.to receive(:fetch_internal_remote)
.with(gitaly_request_with_path(storage_name, relative_path), kind_of(Hash))
.and_return(double(result: true))
expect(client.fetch_internal_remote(remote_repository)).to be(true)
end
end
describe '#find_remote_root_ref' do describe '#find_remote_root_ref' do
it 'sends an find_remote_root_ref message and returns the root ref' do it 'sends an find_remote_root_ref message and returns the root ref' do
expect_any_instance_of(Gitaly::RemoteService::Stub) expect_any_instance_of(Gitaly::RemoteService::Stub)
......
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