From 1b9b41472f0e7b9aac429dc8f95e778a3fce174d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Sat, 24 Jul 2021 18:16:32 +0200 Subject: [PATCH] [rubygems/rubygems] Completely avoid replacing sources when in multisource compatibility mode Since this mode is only enabled in frozen mode, it's fine to use the lockfile and means we don't have to "prepare" the replacement for materialization. https://github.com/rubygems/rubygems/commit/dda01b288e --- lib/bundler/definition.rb | 2 +- lib/bundler/source_list.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 3e357f76d7..a0a4867e09 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -721,7 +721,7 @@ module Bundler @locked_specs.each do |s| # Replace the locked dependency's source with the equivalent source from the Gemfile dep = @dependencies.find {|d| s.satisfies?(d) } - s.source = (dep && dep.source) || sources.get(s.source) + s.source = (dep && dep.source) || sources.get(s.source) unless multisource_allowed? # Don't add a spec to the list if its source is expired. For example, # if you change a Git gem to RubyGems. diff --git a/lib/bundler/source_list.rb b/lib/bundler/source_list.rb index 1c0105bf7e..d6310b78c0 100644 --- a/lib/bundler/source_list.rb +++ b/lib/bundler/source_list.rb @@ -215,7 +215,7 @@ module Bundler end def equal_source?(source, other_source) - return source.include?(other_source) if source.is_a?(Source::Rubygems) && other_source.is_a?(Source::Rubygems) && !merged_gem_lockfile_sections? + return source.include?(other_source) if source.is_a?(Source::Rubygems) && other_source.is_a?(Source::Rubygems) source == other_source end