summaryrefslogtreecommitdiff
path: root/lib/bundler/definition.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2023-07-12 11:15:10 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2023-08-16 15:03:38 +0900
commit6bc63ab9bb3828a59e2c87619922a33bf6b27da3 (patch)
treefedfbe6c1e62681724069ffc8b380a086098ab40 /lib/bundler/definition.rb
parent86492fca653a105d926eb0cad9128e22b324a378 (diff)
[rubygems/rubygems] Refactor locked dep filtering more
We only need to check whether the spec if for a direct dependency once. https://github.com/rubygems/rubygems/commit/65b455a5cb
Diffstat (limited to 'lib/bundler/definition.rb')
-rw-r--r--lib/bundler/definition.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 397b2da7be..5d3931e2b7 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -811,14 +811,14 @@ module Bundler
specs.each do |s|
dep = @dependencies.find {|d| s.satisfies?(d) }
- deps << dep if dep && (!dep.source || s.source.include?(dep.source))
# Replace the locked dependency's source with the equivalent source from the Gemfile
- s.source = if dep&.source
- gemfile_source = dep.source
+ s.source = if dep
+ gemfile_source = dep.source || sources.default_source
lockfile_source = s.source
@specs_that_changed_sources << s if gemfile_source != lockfile_source
+ deps << dep if !dep.source || lockfile_source.include?(dep.source)
gemfile_source
else