update-test: fix --to-tag failure on new tag.

Without this updating to a tag will always have the same start commit
and end commit as there's been no updates to `master` since the tag was
created.
This commit is contained in:
Mike McQuaid 2016-10-29 09:09:00 -04:00
parent 8a7317aa8f
commit 59933f5cd9

View File

@ -32,6 +32,8 @@ module Homebrew
commit commit
elsif date = ARGV.value("before") elsif date = ARGV.value("before")
Utils.popen_read("git", "rev-list", "-n1", "--before=#{date}", "origin/master").chomp Utils.popen_read("git", "rev-list", "-n1", "--before=#{date}", "origin/master").chomp
elsif ARGV.include?("--to-tag")
Utils.popen_read("git", "tag", "--list", "--sort=-version:refname").lines[1].chomp
else else
Utils.popen_read("git", "rev-parse", "origin/master").chomp Utils.popen_read("git", "rev-parse", "origin/master").chomp
end end