From 03a97df974ed419eddfb5f00cd1d5ef9589e2ff1 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Mon, 19 Sep 2011 21:47:17 -0500 Subject: doctor: only check git status if repository exists Closes #7722. Signed-off-by: Jack Nagel --- Library/Homebrew/cmd/doctor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index e8f014392..cad145b5e 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -753,7 +753,7 @@ end def check_git_status status_cmd = "git --git-dir=#{HOMEBREW_REPOSITORY}/.git --work-tree=#{HOMEBREW_PREFIX} status -s #{HOMEBREW_PREFIX}/Library/Homebrew" - if system "/usr/bin/which -s git" and not `#{status_cmd}`.empty? + if system "/usr/bin/which -s git" and File.directory? HOMEBREW_REPOSITORY+'.git' and not `#{status_cmd}`.empty? ohai "You have uncommitted modifications to Homebrew core" puts "Unless you know what you are doing, you should: git reset --hard" puts -- cgit v1.2.3