aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2011-12-16 20:14:19 -0600
committerJack Nagel2011-12-16 20:34:17 -0600
commit9f4f23a7f44c152b876e7e045521b3ebca8ed7dc (patch)
tree7f941db4e3746f26a9ff87ce9f73c2adb5069ab6 /Library
parent7df7bd6a4802edd1a1556a01b498af66b29996d4 (diff)
downloadbrew-9f4f23a7f44c152b876e7e045521b3ebca8ed7dc.tar.bz2
doctor: fix a couple of git-related checks
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 0659722f8..43855f4b4 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -570,8 +570,7 @@ def check_for_multiple_volumes
end
def check_for_git
- git = `/usr/bin/which git`.chomp
- if git.empty?
+ unless system "/usr/bin/which -s git"
puts <<-EOS.undent
"Git" was not found in your path.
@@ -586,19 +585,18 @@ def check_for_git
end
def check_git_newline_settings
- git = `/usr/bin/which git`.chomp
- return if git.empty?
+ return unless system "/usr/bin/which -s git"
- autocrlf=`git config --get core.autocrlf`
- safecrlf=`git config --get core.safecrlf`
+ autocrlf = `git config --get core.autocrlf`.chomp
+ safecrlf = `git config --get core.safecrlf`.chomp
- if autocrlf=='input' and safecrlf=='true'
+ if autocrlf == 'input' and safecrlf == 'true'
puts <<-EOS.undent
Suspicious Git newline settings found.
The detected Git newline settings can cause checkout problems:
- core.autocrlf=#{autocrlf}
- core.safecrlf=#{safecrlf}
+ core.autocrlf = #{autocrlf}
+ core.safecrlf = #{safecrlf}
If you are not routinely dealing with Windows-based projects,
consider removing these settings.