diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 32afea120d..b457fd9279 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -291,6 +291,14 @@ class GitDownloadStrategy < AbstractDownloadStrategy end def support_depth? + !commit_history_required? and depth_supported_host? + end + + def commit_history_required? + @spec == :sha + end + + def depth_supported_host? @url =~ %r(git://) or @url =~ %r(https://github.com/) end