diff options
author | Stan Hu <stanhu@gmail.com> | 2018-03-02 05:50:17 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-03-06 00:10:04 -0800 |
commit | e9fad3e501f6c8fa7ebc58011e5bf9fff379617e (patch) | |
tree | c30dfebb3a9e9afd1e9884f56117411c34ae35d9 /spec/lib/gitlab/gitaly_client/repository_service_spec.rb | |
parent | 2e87923dcb1cf7984690f5b5fdfc61bddfba923e (diff) | |
download | gitlab-ce-e9fad3e501f6c8fa7ebc58011e5bf9fff379617e.tar.gz |
Make --prune a configurable parameter in fetching a git remotesh-make-prune-optional-in-git-fetch
By default, --prune is added to the command-line of a `git fetch` operation,
but for repositories with many references this can take a long time to run. We
shouldn't need to run --prune the first time we fetch a new repository.
Diffstat (limited to 'spec/lib/gitlab/gitaly_client/repository_service_spec.rb')
-rw-r--r-- | spec/lib/gitlab/gitaly_client/repository_service_spec.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/lib/gitlab/gitaly_client/repository_service_spec.rb b/spec/lib/gitlab/gitaly_client/repository_service_spec.rb index c50e73cecfc..1c41dbcb9ef 100644 --- a/spec/lib/gitlab/gitaly_client/repository_service_spec.rb +++ b/spec/lib/gitlab/gitaly_client/repository_service_spec.rb @@ -85,6 +85,20 @@ describe Gitlab::GitalyClient::RepositoryService do end end + describe '#fetch_remote' do + let(:ssh_auth) { double(:ssh_auth, ssh_import?: true, ssh_key_auth?: false, ssh_known_hosts: nil) } + let(:import_url) { 'ssh://example.com' } + + it 'sends a fetch_remote_request message' do + expect_any_instance_of(Gitaly::RepositoryService::Stub) + .to receive(:fetch_remote) + .with(gitaly_request_with_params(no_prune: false), kind_of(Hash)) + .and_return(double(value: true)) + + client.fetch_remote(import_url, ssh_auth: ssh_auth, forced: false, no_tags: false, timeout: 60) + end + end + describe '#rebase_in_progress?' do let(:rebase_id) { 1 } |