diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2023-07-13 12:48:05 +0200 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2023-08-16 15:03:38 +0900 |
commit | 7bb3e637ffedf34fa148d4fbf35b57681490c7e1 (patch) | |
tree | 727998f14bb0c8682039f77fccbb70da19269717 /lib/bundler/definition.rb | |
parent | c57ab646cbefc50a8e8d21faec8a60643b1a057c (diff) |
[rubygems/rubygems] Don't update locked sources when not necessary
https://github.com/rubygems/rubygems/commit/cfc82b592a
Diffstat (limited to 'lib/bundler/definition.rb')
-rw-r--r-- | lib/bundler/definition.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index f970301a23..8d90e2501d 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -813,16 +813,17 @@ module Bundler dep = @dependencies.find {|d| s.satisfies?(d) } lockfile_source = s.source - # Replace the locked dependency's source with the equivalent source from the Gemfile - s.source = if dep + if dep gemfile_source = dep.source || default_source @specs_that_changed_sources << s if gemfile_source != lockfile_source deps << dep if !dep.source || lockfile_source.include?(dep.source) - gemfile_source + # Replace the locked dependency's source with the equivalent source from the Gemfile + s.source = gemfile_source else - sources.get_with_fallback(lockfile_source) + # Replace the locked dependency's source with the default source, if the locked source is no longer in the Gemfile + s.source = default_source unless sources.get(lockfile_source) end next if @unlock[:sources].include?(s.source.name) |