doctor: clean up check_git_status

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2011-12-28 19:32:40 -06:00
parent 647e7f1126
commit 66dcfcd8cc

View File

@ -751,14 +751,15 @@ def check_missing_deps
end
def check_git_status
repo = HOMEBREW_REPOSITORY
status_cmd = "git --git-dir=#{repo}/.git --work-tree=#{repo} status -s #{repo}/Library/Homebrew"
if system "/usr/bin/which -s git" and File.directory? repo+'.git' and not `#{status_cmd}`.empty?
HOMEBREW_REPOSITORY.cd do
cmd = `git status -s Library/Homebrew/`.chomp
if system "/usr/bin/which -s git" and File.directory? '.git' and not cmd.empty?
ohai "You have uncommitted modifications to Homebrew's core."
puts "Unless you know what you are doing, you should: git reset --hard"
puts
end
end
end
def check_for_leopard_ssl
if MacOS.leopard? and not ENV['GIT_SSL_NO_VERIFY']