aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobert Wahler <robert@gearheadforhire.com>2011-08-18 11:21:09 -0400
committerRobert Wahler <robert@gearheadforhire.com>2011-08-18 11:21:09 -0400
commitdc15dc56446ab10c17028810ac83eb577b375753 (patch)
tree35609ad39c977f299ecb443658e060a7de3f634f /lib
parenta42c97af98e042a9d55407230ba6e62e6d71e5ad (diff)
downloadbundler-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.rb8
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