aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2011-09-09 09:24:03 +0100
committerMax Howell2011-09-09 09:24:16 +0100
commit67bc01e53ed5d19637880c755a769cae2f4ad10b (patch)
treed89c383662cd02585daeccdf1863776c04a73eab /Library
parent34c731f093277f8d6027245a40263c7a1d390a09 (diff)
downloadhomebrew-67bc01e53ed5d19637880c755a769cae2f4ad10b.tar.bz2
The doctor notices modifications to Homebrew core
Refs #7525.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 4f971791c..743c94fa5 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -749,6 +749,13 @@ def check_missing_deps
end
end
+def check_git_status
+ if system "/usr/bin/which -s git" and not `git status -s #{HOMEBREW_PREFIX}/Library/Homebrew`.empty?
+ ohai "You have uncommitted modifications to Homebrew core"
+ puts "Unless you know what you are doing, you should: git reset --hard"
+ end
+end
+
module Homebrew extend self
def doctor
old_stdout = $stdout
@@ -791,6 +798,7 @@ module Homebrew extend self
check_for_other_frameworks
check_tmpdir
check_missing_deps
+ check_git_status
ensure
$stdout = old_stdout
end