diff options
author | Robert Wahler <robert@gearheadforhire.com> | 2011-08-18 11:21:09 -0400 |
---|---|---|
committer | Robert Wahler <robert@gearheadforhire.com> | 2011-08-18 11:21:09 -0400 |
commit | dc15dc56446ab10c17028810ac83eb577b375753 (patch) | |
tree | 35609ad39c977f299ecb443658e060a7de3f634f /lib | |
parent | a42c97af98e042a9d55407230ba6e62e6d71e5ad (diff) | |
download | bundler-dc15dc56446ab10c17028810ac83eb577b375753.tar.gz |
Gemfile.lock should not be touched if nothing has changed
This fixes issue #1105, Gemfile.lock always updated on Windows
when running bundle install
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/definition.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 962838aa..82e1aa3e 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -180,6 +180,10 @@ module Bundler def lock(file) contents = to_lock + # Convert to \r\n if the existing lock has them + # i.e., Windows with `git config core.autocrlf=true` + contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match("\r\n") + return if @lockfile_contents == contents if Bundler.settings[:frozen] @@ -187,10 +191,6 @@ module Bundler return end - # Convert to \r\n if the existing lock has them - # i.e., Windows with `git config core.autocrlf=true` - contents.gsub!(/\n/, "\r\n") if @lockfile_contents.match("\r\n") - File.open(file, 'wb'){|f| f.puts(contents) } end |