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?