doctor: make git status check saner
The order of things made the check for git in the path pointless (and was my fault); this is a better way to do it. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
2d5de8c7ed
commit
caa3c4f864
@ -732,9 +732,9 @@ def check_missing_deps
|
||||
end
|
||||
|
||||
def check_git_status
|
||||
return unless system "/usr/bin/which -s git"
|
||||
HOMEBREW_REPOSITORY.cd do
|
||||
cmd = `git status -s Library/Homebrew/ 2> /dev/null`.chomp
|
||||
if system "/usr/bin/which -s git" and File.directory? '.git' and not cmd.empty? then <<-EOS.undent
|
||||
unless `git status -s -- Library/Homebrew/ 2>/dev/null`.chomp.empty? then <<-EOS.undent
|
||||
You have uncommitted modifications to Homebrew's core.
|
||||
Unless you know what you are doing, you should run:
|
||||
cd #{HOMEBREW_REPOSITORY} && git reset --hard
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user