doctor: check_git_status in correct location
This would silently fail if HOMEBREW_REPOSITORY != HOMEBREW_PREFIX, which is obviously a valid Homebrew setup. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
784e3b2dfd
commit
6b9fa0b818
@ -750,8 +750,9 @@ def check_missing_deps
|
|||||||
end
|
end
|
||||||
|
|
||||||
def check_git_status
|
def check_git_status
|
||||||
status_cmd = "git --git-dir=#{HOMEBREW_REPOSITORY}/.git --work-tree=#{HOMEBREW_PREFIX} status -s #{HOMEBREW_PREFIX}/Library/Homebrew"
|
repo = HOMEBREW_REPOSITORY
|
||||||
if system "/usr/bin/which -s git" and File.directory? HOMEBREW_REPOSITORY+'.git' and not `#{status_cmd}`.empty?
|
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?
|
||||||
ohai "You have uncommitted modifications to Homebrew's core."
|
ohai "You have uncommitted modifications to Homebrew's core."
|
||||||
puts "Unless you know what you are doing, you should: git reset --hard"
|
puts "Unless you know what you are doing, you should: git reset --hard"
|
||||||
puts
|
puts
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user