aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorJack Nagel2011-12-28 19:32:40 -0600
committerJack Nagel2011-12-28 19:55:02 -0600
commit5bc2d70cadeca131dad56dadd1b980bc226185cf (patch)
tree0d5fac8aa18099577edf9de77ee9549523085943 /Library/Homebrew/cmd
parent14262d5891718b49ca5b9a04d1d4dcfb62694aaa (diff)
downloadhomebrew-5bc2d70cadeca131dad56dadd1b980bc226185cf.tar.bz2
doctor: clean up check_git_status
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/doctor.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index eb9ec885f..bc32883fe 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -751,12 +751,13 @@ 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?
- ohai "You have uncommitted modifications to Homebrew's core."
- puts "Unless you know what you are doing, you should: git reset --hard"
- puts
+ 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