update-test: tweak master not updated check.

Loosen this a bit; we don't necessarily expect the end commit is the one
we're looking for, just that it has changed from the start commit (i.e.
some sort of update has occurred).

Addresses some false negatives on `master` branch merges that weren't
present on the PR commits.
This commit is contained in:
Mike McQuaid 2016-08-14 11:52:22 +01:00
parent d5005f4d8b
commit 65164cb386

View File

@ -15,7 +15,7 @@ module Homebrew
Utils.popen_read("git", "rev-list", "-n1", "--before=#{date}", "origin/master").chomp Utils.popen_read("git", "rev-list", "-n1", "--before=#{date}", "origin/master").chomp
else else
Utils.popen_read("git", "rev-parse", "origin/master").chomp Utils.popen_read("git", "rev-parse", "origin/master").chomp
end end
start_sha1 = Utils.popen_read("git", "rev-parse", start_sha1).chomp start_sha1 = Utils.popen_read("git", "rev-parse", start_sha1).chomp
end_sha1 = Utils.popen_read("git", "rev-parse", "HEAD").chomp end_sha1 = Utils.popen_read("git", "rev-parse", "HEAD").chomp
@ -49,7 +49,7 @@ module Homebrew
oh1 "Running brew update..." oh1 "Running brew update..."
safe_system "brew", "update", "--verbose" safe_system "brew", "update", "--verbose"
actual_end_sha1 = Utils.popen_read("git", "rev-parse", "master").chomp actual_end_sha1 = Utils.popen_read("git", "rev-parse", "master").chomp
if actual_end_sha1 != end_sha1 if start_sha1 != end_sha1 && start_sha1 == actual_end_sha1
raise <<-EOS.undent raise <<-EOS.undent
brew update didn't update master! brew update didn't update master!
Start commit: #{start_sha1} Start commit: #{start_sha1}