diagnostic: only warn about local newline config

cd to `HOMEBREW_REPOSITORY` before checking git newline settings.

Closes Homebrew/homebrew#49565.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Josh Hagins 2016-02-26 13:35:36 -05:00 committed by Mike McQuaid
parent 76767f3d6e
commit e404a71e43

View File

@ -1003,7 +1003,7 @@ module Homebrew
def check_git_newline_settings def check_git_newline_settings
return unless Utils.git_available? return unless Utils.git_available?
autocrlf = `git config --get core.autocrlf`.chomp autocrlf = HOMEBREW_REPOSITORY.cd { `git config --get core.autocrlf`.chomp }
if autocrlf == "true" then <<-EOS.undent if autocrlf == "true" then <<-EOS.undent
Suspicious Git newline settings found. Suspicious Git newline settings found.