From 9fd3150c8ab480509c341881f1f3b15efa455d87 Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Tue, 10 Oct 2023 07:37:00 -0600 Subject: [PATCH] skip pre-install when we're unlocking --- lib/bundler/multilock.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/bundler/multilock.rb b/lib/bundler/multilock.rb index 3c00efe..c6cbe94 100644 --- a/lib/bundler/multilock.rb +++ b/lib/bundler/multilock.rb @@ -426,9 +426,16 @@ def write_lockfile(lockfile_definition, lockfile, install:, dependency_changes: orig_definition = definition.dup # we might need it twice + # install gems for the exact current version of the lockfile + # this ensures it doesn't re-resolve with only (different) + # local gems after you've pulled down an update to the lockfile + # from someone else if current_lockfile.exist? && install Bundler.settings.temporary(frozen: true) do current_definition = builder.to_definition(current_lockfile, {}) + # if something has changed, we skip this step; it's unlocking anyway + next unless current_definition.no_resolve_needed? + current_definition.resolve_with_cache! if current_definition.missing_specs.any? Bundler.with_default_lockfile(current_lockfile) do