From 486485a535ece120dec5daa37c6b06c9d3af7e17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rodr=C3=ADguez?= Date: Tue, 19 Nov 2024 20:41:32 +0100 Subject: [PATCH] [rubygems/rubygems] Refactor https://github.com/rubygems/rubygems/commit/9964c16bb9 --- lib/bundler/definition.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 4f620bdd27..52699d14be 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -951,7 +951,6 @@ module Bundler gemfile_source = dep.source || default_source deps << dep if !dep.source || lockfile_source.include?(dep.source) - @gems_to_unlock << name if lockfile_source.include?(dep.source) && lockfile_source != gemfile_source # Replace the locked dependency's source with the equivalent source from the Gemfile s.source = gemfile_source @@ -964,7 +963,7 @@ module Bundler next if @sources_to_unlock.include?(source.name) # Path sources have special logic - if source.instance_of?(Source::Path) || source.instance_of?(Source::Gemspec) + if source.instance_of?(Source::Path) || source.instance_of?(Source::Gemspec) || (source.instance_of?(Source::Git) && !@gems_to_unlock.include?(name) && deps.include?(dep)) new_spec = source.specs[s].first if new_spec s.dependencies.replace(new_spec.dependencies)