GitDownloadStrategy: generalize has_tag? to has_ref?

This commit is contained in:
Jack Nagel 2013-02-17 15:41:24 -06:00
parent f62818210d
commit 612745352d

View File

@ -356,8 +356,8 @@ class GitDownloadStrategy < AbstractDownloadStrategy
@clone.join(".git") @clone.join(".git")
end end
def has_tag?(tag) def has_ref?
quiet_system @@git, '--git-dir', git_dir, 'rev-parse', '-q', '--verify', tag quiet_system @@git, '--git-dir', git_dir, 'rev-parse', '-q', '--verify', @ref
end end
def support_depth? def support_depth?
@ -401,7 +401,7 @@ class GitDownloadStrategy < AbstractDownloadStrategy
end end
def update_repo def update_repo
unless @spec == :tag && has_tag?(@ref) unless @spec == :tag && has_ref?
quiet_safe_system @@git, 'fetch', 'origin' quiet_safe_system @@git, 'fetch', 'origin'
end end
end end