Merge pull request #17201 from Homebrew/fix-internal-formula-json-v3-frozen-hash-bug
Fix internal formula json v3 frozen hash parsing bug
This commit is contained in:
commit
bd72ec812c
@ -7,9 +7,10 @@ module Cachable
|
||||
@cache ||= T.let({}, T.nilable(T::Hash[T.untyped, T.untyped]))
|
||||
end
|
||||
|
||||
# NOTE: We overwrite here instead of using `Hash#clear` to handle frozen hashes.
|
||||
sig { void }
|
||||
def clear_cache
|
||||
cache.clear
|
||||
overwrite_cache!({})
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -226,7 +226,7 @@ module Formulary
|
||||
end
|
||||
|
||||
if info&.key?("uses_from_macos")
|
||||
bounds = info["uses_from_macos"] || {}
|
||||
bounds = info["uses_from_macos"].dup || {}
|
||||
bounds.deep_transform_keys!(&:to_sym)
|
||||
bounds.deep_transform_values!(&:to_sym)
|
||||
|
||||
|
@ -33,7 +33,7 @@ RSpec.describe "Internal Tap JSON -- Formula", type: :system do
|
||||
|
||||
allow(Homebrew::API).to receive(:fetch_json_api_file)
|
||||
.with("internal/v3/homebrew-core.jws.json")
|
||||
.and_return([JSON.parse(internal_tap_json), false])
|
||||
.and_return([JSON.parse(internal_tap_json, freeze: true), false])
|
||||
|
||||
# `Tap.tap_migration_oldnames` looks for renames in every
|
||||
# tap so `CoreCaskTap.tap_migrations` gets called and tries to
|
||||
|
Loading…
x
Reference in New Issue
Block a user