diff options
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/download_strategy.rb | 8 |
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? |
