aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/download_strategy.rb
diff options
context:
space:
mode:
authorJack Nagel2013-11-05 22:06:20 -0600
committerJack Nagel2013-11-05 22:06:20 -0600
commite470010f2e11135611409c606b76167e5fceae7b (patch)
treef1cbb200bf416f0f926e99c05d41ea816a03f4d0 /Library/Homebrew/download_strategy.rb
parent0c523da706b381b3a72df46794cda75aacdcfc35 (diff)
downloadbrew-e470010f2e11135611409c606b76167e5fceae7b.tar.bz2
Add git.sv.gnu.org repositories to shallow-clone whitelist
Diffstat (limited to 'Library/Homebrew/download_strategy.rb')
-rw-r--r--Library/Homebrew/download_strategy.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 72b4b8f03..a3e08c1f4 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -498,8 +498,14 @@ class GitDownloadStrategy < VCSDownloadStrategy
@ref_type != :revision and host_supports_depth?
end
+ SHALLOW_CLONE_WHITELIST = [
+ %r{git://},
+ %r{https://github\.com},
+ %r{http://git\.sv\.gnu\.org},
+ ]
+
def host_supports_depth?
- @url =~ %r{git://} or @url =~ %r{https://github.com/}
+ SHALLOW_CLONE_WHITELIST.any? { |rx| rx === @url }
end
def repo_valid?