diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-09 12:40:15 +0200 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-09-02 13:14:12 +0200 |
commit | 88402a209bbd1312a18e1891b225b95f51952e14 (patch) | |
tree | 0687934ae0803f344e2cb9a3a9a8e920f0bc8fad | |
parent | 508d5f138469c85b028e0ebda95979a050149957 (diff) | |
download | bundler-faster_git_clone.tar.gz |
Use `--depth 1` for `git fetch` toofaster_git_clone
-rw-r--r-- | lib/bundler/source/git/git_proxy.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bundler/source/git/git_proxy.rb b/lib/bundler/source/git/git_proxy.rb index 257cb9c8d0..3580afdf4b 100644 --- a/lib/bundler/source/git/git_proxy.rb +++ b/lib/bundler/source/git/git_proxy.rb @@ -114,7 +114,11 @@ module Bundler end in_path do - git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref}) + if remote?(uri) + git_retry %(fetch --force --quiet --depth 1 --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref}) + else + git_retry %(fetch --force --quiet --tags #{uri_escaped_with_configured_credentials} "refs/heads/*:refs/heads/*" #{extra_ref}) + end end end |