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
commit3cc8d58d925a6b0af8135ef6f1bf1d3713e25452 (patch)
treec3acef9b5cecbd6d1553f5ee286bc67fc0b25679 /Library
parent93f03aa278c9260b9dda7bb32206c0edf6b4ebd4 (diff)
downloadhomebrew-3cc8d58d925a6b0af8135ef6f1bf1d3713e25452.tar.bz2
Only clone with a depth when targeting HEAD or a tag.
Closes #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