From c6f5d24238c452ad5f13d597ff613e5477abb14a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 2 Oct 2016 17:16:35 +0100 Subject: [PATCH] update-test: fix tag updating, skip core tap. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix updating the `stable` branch used for tagged updates and ensure that the core tap isn’t retapped (the slowest part by far of this test). --- Library/Homebrew/cmd/update-report.rb | 1 + Library/Homebrew/dev-cmd/update-test.rb | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index f97191bdaf..357bc3fc15 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -113,6 +113,7 @@ module Homebrew end def install_core_tap_if_necessary + return if ENV["HOMEBREW_UPDATE_TEST"] core_tap = CoreTap.instance return if core_tap.installed? CoreTap.ensure_installed! quiet: false diff --git a/Library/Homebrew/dev-cmd/update-test.rb b/Library/Homebrew/dev-cmd/update-test.rb index 8d0391f664..79b9f621ba 100644 --- a/Library/Homebrew/dev-cmd/update-test.rb +++ b/Library/Homebrew/dev-cmd/update-test.rb @@ -16,7 +16,14 @@ module Homebrew def update_test - ENV["HOMEBREW_UPDATE_TO_TAG"] = "1" if ARGV.include?("--to-tag") + ENV["HOMEBREW_UPDATE_TEST"] = "1" + + if ARGV.include?("--to-tag") + ENV["HOMEBREW_UPDATE_TO_TAG"] = "1" + branch = "stable" + else + branch = "master" + end cd HOMEBREW_REPOSITORY start_commit = if commit = ARGV.value("commit") @@ -57,10 +64,10 @@ module Homebrew # run brew update oh1 "Running brew update..." safe_system "brew", "update", "--verbose" - actual_end_commit = Utils.popen_read("git", "rev-parse", "master").chomp + actual_end_commit = Utils.popen_read("git", "rev-parse", branch).chomp if start_commit != end_commit && start_commit == actual_end_commit raise <<-EOS.undent - brew update didn't update master! + brew update didn't update #{branch}! Start commit: #{start_commit} Expected end commit: #{end_commit} Actual end commit: #{actual_end_commit}