mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
update-test: fix tag updating, skip core tap.
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).
This commit is contained in:
parent
f90f52d902
commit
c6f5d24238
@ -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
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user