Only clone with a depth when targeting HEAD or a tag.

Closes Homebrew/homebrew#7101.

Signed-off-by: Max Howell <max@methylblue.com>
This commit is contained in:
Ben Burkert 2011-08-19 11:08:46 -07:00 committed by Max Howell
parent 0822907d6d
commit f54a30a534

View File

@ -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