Skip to content

Commit

Permalink
Fix issue with bundle update with an out of sync lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
deivid-rodriguez committed Apr 23, 2024
1 parent 32f78e6 commit 3f49b3e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bundler/lib/bundler/definition.rb
Expand Up @@ -92,11 +92,12 @@ def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, opti
@platforms = @locked_platforms.dup
@locked_bundler_version = @locked_gems.bundler_version
@locked_ruby_version = @locked_gems.ruby_version
@originally_locked_deps = @locked_gems.dependencies
@originally_locked_specs = SpecSet.new(@locked_gems.specs)
@locked_checksums = @locked_gems.checksums

if unlock != true
@locked_deps = @locked_gems.dependencies
@locked_deps = @originally_locked_deps
@locked_specs = @originally_locked_specs
@locked_sources = @locked_gems.sources
else
Expand All @@ -111,6 +112,7 @@ def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, opti
@locked_gems = nil
@locked_deps = {}
@locked_specs = SpecSet.new([])
@originally_locked_deps = {}
@originally_locked_specs = @locked_specs
@locked_sources = []
@locked_platforms = []
Expand Down Expand Up @@ -835,9 +837,7 @@ def converge_dependencies
dep.source = sources.get(dep.source)
end

next if unlocking?

unless locked_dep = @locked_deps[dep.name]
unless locked_dep = @originally_locked_deps[dep.name]
changes = true
next
end
Expand Down

0 comments on commit 3f49b3e

Please sign in to comment.