[rubygems/rubygems] Swapping should not raise any errors

https://github.com/rubygems/rubygems/commit/600a9ac658
This commit is contained in:
David Rodríguez 2022-06-09 11:06:32 +02:00 committed by git
parent 6292b36529
commit bf8dc36e40

View File

@ -157,11 +157,12 @@ module Bundler
path = fetch_gem(spec, options[:previous_spec])
begin
s = Bundler.rubygems.spec_from_gem(path, Bundler.settings["trust-policy"])
spec.__swap__(s)
rescue Gem::Package::FormatError
Bundler.rm_rf(path)
raise
end
spec.__swap__(s)
else
path = cached_gem(spec)
raise GemNotFound, "Could not find #{spec.file_name} for installation" unless path