From e470010f2e11135611409c606b76167e5fceae7b Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Tue, 5 Nov 2013 22:06:20 -0600 Subject: [PATCH] Add git.sv.gnu.org repositories to shallow-clone whitelist --- Library/Homebrew/download_strategy.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 72b4b8f03e..a3e08c1f49 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?