diff options
author | Stan Hu <stanhu@gmail.com> | 2018-03-02 16:50:17 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-03-06 11:10:04 +0300 |
commit | e9fad3e501f6c8fa7ebc58011e5bf9fff379617e (patch) | |
tree | c30dfebb3a9e9afd1e9884f56117411c34ae35d9 /lib/gitlab/gitaly_client/repository_service.rb | |
parent | 2e87923dcb1cf7984690f5b5fdfc61bddfba923e (diff) |
Make --prune a configurable parameter in fetching a git remote
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 'lib/gitlab/gitaly_client/repository_service.rb')
-rw-r--r-- | lib/gitlab/gitaly_client/repository_service.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/gitaly_client/repository_service.rb b/lib/gitlab/gitaly_client/repository_service.rb index fdb3247cf4d..e1bc2f9ab61 100644 --- a/lib/gitlab/gitaly_client/repository_service.rb +++ b/lib/gitlab/gitaly_client/repository_service.rb @@ -45,10 +45,10 @@ module Gitlab GitalyClient.call(@storage, :repository_service, :apply_gitattributes, request) end - def fetch_remote(remote, ssh_auth:, forced:, no_tags:, timeout:) + def fetch_remote(remote, ssh_auth:, forced:, no_tags:, timeout:, prune: true) request = Gitaly::FetchRemoteRequest.new( repository: @gitaly_repo, remote: remote, force: forced, - no_tags: no_tags, timeout: timeout + no_tags: no_tags, timeout: timeout, no_prune: !prune ) if ssh_auth&.ssh_import? |