summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFranz Liedke <franz@develophp.org>2023-12-02 20:03:39 +0100
committergit <svn-admin@ruby-lang.org>2023-12-12 01:08:20 +0000
commit0653fb026cd2203158b7af1e8b9608911dce2860 (patch)
tree2d6d2f8f34c81fff717ce375bd2d5027e16fe9a3 /lib
parent0ec88b54f34ee0b0197f963ad6a98a2390a91de7 (diff)
[rubygems/rubygems] Refactor: Move filesystem access into Definition class
https://github.com/rubygems/rubygems/commit/2720da2659
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli/lock.rb1
-rw-r--r--lib/bundler/definition.rb5
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundler/cli/lock.rb b/lib/bundler/cli/lock.rb
index 960357493d..7247121df5 100644
--- a/lib/bundler/cli/lock.rb
+++ b/lib/bundler/cli/lock.rb
@@ -64,7 +64,6 @@ module Bundler
file = file ? File.expand_path(file) : Bundler.default_lockfile
puts "Writing lockfile to #{file}"
definition.lock(file)
- FileUtils.touch(file)
end
end
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 88f25c962f..a19c2ddf78 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -342,7 +342,10 @@ module Bundler
preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
- return if file && File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
+ if file && File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
+ FileUtils.touch(file)
+ return
+ end
if Bundler.frozen_bundle?
Bundler.ui.error "Cannot write a changed lockfile while frozen."