diff options
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 |