Merge pull request #2693 from MikeMcQuaid/update-test-more-tweaks

update-test: tweak more edge cases.
This commit is contained in:
Mike McQuaid 2017-05-29 15:44:50 +01:00 committed by GitHub
commit 481a91a92d

View File

@ -36,8 +36,12 @@ module Homebrew
tags = Utils.popen_read("git", "tag", "--list", "--sort=-version:refname")
previous_tag = tags.lines[1]
previous_tag ||= begin
safe_system "git", "fetch", "--tags", "--depth=1"
tags = Utils.popen_read("git", "tag", "--list", "--sort=-version:refname")
if (HOMEBREW_REPOSITORY/".git/shallow").exist?
safe_system "git", "fetch", "--tags", "--depth=1"
tags = Utils.popen_read("git", "tag", "--list", "--sort=-version:refname")
elsif OS.linux?
tags = Utils.popen_read("git tag --list | sort -rV")
end
tags.lines[1]
end
previous_tag = previous_tag.to_s.chomp