diff --git a/Library/Homebrew/cmd/reinstall.rb b/Library/Homebrew/cmd/reinstall.rb index 5f8a75144d..5ace087d93 100644 --- a/Library/Homebrew/cmd/reinstall.rb +++ b/Library/Homebrew/cmd/reinstall.rb @@ -109,7 +109,7 @@ module Homebrew sig { override.void } def run formulae, casks = T.cast( - args.named.to_formulae_and_casks(method: :resolve).partition { _1.is_a?(Formula) }, + args.named.to_resolved_formulae_to_casks, [T::Array[Formula], T::Array[Cask::Cask]], ) @@ -126,7 +126,8 @@ module Homebrew if Homebrew::Attestation.enabled? if formulae.include?(Formula["gh"]) - formulae.unshift(T.must(formulae.delete(Formula["gh"]))) + # Move `gh` to the front of the list so that it gets installed first. + formulae = [Formula["gh"]] | formulae else Homebrew::Attestation.gh_executable end diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index cab4f27556..f3cceed9de 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -136,7 +136,8 @@ module Homebrew if Homebrew::Attestation.enabled? if formulae.include?(Formula["gh"]) - formulae.unshift(formulae.delete(Formula["gh"])) + # Move `gh` to the front of the list so that it gets installed first. + formulae = [Formula["gh"]] | formulae else Homebrew::Attestation.gh_executable end