Skip to content

Commit

Permalink
[rubygems/rubygems] Refactor locked dep filtering more
Browse files Browse the repository at this point in the history
We only need to check whether the spec if for a direct dependency once.

rubygems/rubygems@65b455a5cb
  • Loading branch information
deivid-rodriguez authored and hsbt committed Aug 16, 2023
1 parent 86492fc commit 6bc63ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/bundler/definition.rb
Expand Up @@ -811,14 +811,14 @@ def converge_specs(specs)

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
Expand Down

0 comments on commit 6bc63ab

Please sign in to comment.