diff options
| author | Jack Nagel | 2013-11-05 22:06:20 -0600 | 
|---|---|---|
| committer | Jack Nagel | 2013-11-05 22:06:20 -0600 | 
| commit | e470010f2e11135611409c606b76167e5fceae7b (patch) | |
| tree | f1cbb200bf416f0f926e99c05d41ea816a03f4d0 /Library/Homebrew/download_strategy.rb | |
| parent | 0c523da706b381b3a72df46794cda75aacdcfc35 (diff) | |
| download | brew-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.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?  | 
