diff --git a/Library/Homebrew/attestation.rb b/Library/Homebrew/attestation.rb index acf1c5c20a..76b1c27cc0 100644 --- a/Library/Homebrew/attestation.rb +++ b/Library/Homebrew/attestation.rb @@ -75,6 +75,7 @@ module Homebrew # NOTE: We set HOMEBREW_NO_VERIFY_ATTESTATIONS when installing `gh` itself, # to prevent a cycle during bootstrapping. This can eventually be resolved # by vendoring a pure-Ruby Sigstore verifier client. + @gh_executable ||= T.let(nil, T.nilable(Pathname)) return @gh_executable if @gh_executable.present? with_env(HOMEBREW_NO_VERIFY_ATTESTATIONS: "1") do @@ -88,7 +89,7 @@ module Homebrew end end - @gh_executable + T.must(@gh_executable) end # Verifies the given bottle against a cryptographic attestation of build provenance. diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 372326c74f..bab0b2e903 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -265,7 +265,7 @@ module Homebrew if Homebrew::Attestation.enabled? if formulae.include?(Formula["gh"]) - formulae.unshift(formulae.delete(Formula["gh"])) + formulae.unshift(T.must(formulae.delete(Formula["gh"]))) else Homebrew::Attestation.ensure_gh_installed! end