[rubygems/rubygems] Ensure that the lockfile mtime is not altered on frozen install
https://github.com/rubygems/rubygems/commit/6847709ee0
This commit is contained in:
parent
6b3abcf462
commit
1e5c8afb15
@ -343,7 +343,8 @@ module Bundler
|
||||
preserve_unknown_sections ||= !updating_major && (Bundler.frozen_bundle? || !(unlocking? || @unlocking_bundler))
|
||||
|
||||
if file && File.exist?(file) && lockfiles_equal?(@lockfile_contents, contents, preserve_unknown_sections)
|
||||
SharedHelpers.filesystem_access(file) {|p| FileUtils.touch(p) }
|
||||
return if Bundler.frozen_bundle?
|
||||
SharedHelpers.filesystem_access(file) { FileUtils.touch(file) }
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -237,7 +237,9 @@ RSpec.describe "install in deployment or frozen mode" do
|
||||
|
||||
it "installs gems by default to vendor/bundle" do
|
||||
bundle "config set deployment true"
|
||||
expect do
|
||||
bundle "install"
|
||||
end.not_to change { bundled_app_lock.mtime }
|
||||
expect(out).to include("vendor/bundle")
|
||||
end
|
||||
|
||||
@ -256,11 +258,15 @@ RSpec.describe "install in deployment or frozen mode" do
|
||||
|
||||
it "works with the `frozen` setting" do
|
||||
bundle "config set frozen true"
|
||||
expect do
|
||||
bundle "install"
|
||||
end.not_to change { bundled_app_lock.mtime }
|
||||
end
|
||||
|
||||
it "works with BUNDLE_FROZEN if you didn't change anything" do
|
||||
expect do
|
||||
bundle :install, env: { "BUNDLE_FROZEN" => "true" }
|
||||
end.not_to change { bundled_app_lock.mtime }
|
||||
end
|
||||
|
||||
it "explodes with the `deployment` setting if you make a change and don't check in the lockfile" do
|
||||
|
@ -11,6 +11,11 @@ RSpec.describe "bundle install with a lockfile present" do
|
||||
install_gemfile(gf)
|
||||
end
|
||||
|
||||
it "touches the lockfile on install even when nothing has changed" do
|
||||
subject
|
||||
expect { bundle :install }.to change { bundled_app_lock.mtime }
|
||||
end
|
||||
|
||||
context "gemfile evaluation" do
|
||||
let(:gf) { super() + "\n\n File.open('evals', 'a') {|f| f << %(1\n) } unless ENV['BUNDLER_SPEC_NO_APPEND']" }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user