Skip to content

Commit

Permalink
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.
  • Loading branch information
deivid-rodriguez committed Aug 7, 2023
1 parent 2ab63bb commit 65b455a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bundler/lib/bundler/definition.rb
Original file line number Diff line number Diff line change
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 65b455a

Please sign in to comment.