aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorBen Burkert2011-08-19 11:08:46 -0700
committerMax Howell2011-08-26 14:31:49 +0100
commitf54a30a534525df48af6396a90a5729c8bc8618b (patch)
treee2a54e1f8a87baf3b9ae9673e2a607f3b7bc1434 /Library
parent0822907d6d7452f2b7af093bc193d01b489478d7 (diff)
downloadbrew-f54a30a534525df48af6396a90a5729c8bc8618b.tar.bz2
Only clone with a depth when targeting HEAD or a tag.
Closes Homebrew/homebrew#7101. Signed-off-by: Max Howell <max@methylblue.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/download_strategy.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 32afea120..b457fd927 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -291,6 +291,14 @@ class GitDownloadStrategy < AbstractDownloadStrategy
end
def support_depth?
+ !commit_history_required? and depth_supported_host?
+ end
+
+ def commit_history_required?
+ @spec == :sha
+ end
+
+ def depth_supported_host?
@url =~ %r(git://) or @url =~ %r(https://github.com/)
end