Apply suggestions from code review

This commit is contained in:
William Woodruff 2024-07-14 16:30:12 -04:00 committed by GitHub
parent 1ae21d2731
commit ad1500ad60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -62,7 +62,7 @@ module Homebrew
# @api private
sig { returns(Pathname) }
def self.gh_executable
# NOTE: We disable HOMEBREW_NO_VERIFY_ATTESTATIONS when installing `gh` itself,
# 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(with_env(HOMEBREW_NO_VERIFY_ATTESTATIONS: "1") do
@ -111,7 +111,7 @@ module Homebrew
.stdout.match(/\d+(?:\.\d+)+/i).to_s)
if gh_version < GH_ATTESTATION_MIN_VERSION
raise e,
"#{gh_executable} is too old, you must upgrade it to continue."
"#{gh_executable} is too old, you must upgrade it to continue"
end
raise InvalidAttestationError, "attestation verification failed: #{e}"

View File

@ -77,7 +77,7 @@ RSpec.describe Homebrew::Attestation do
end
end
describe "::check_attestation (with old gh)" do
describe "::check_attestation fails with old gh" do
before do
allow(described_class).to receive(:gh_executable)
.and_return(fake_old_gh)