Permalink
Browse files

doctor: improve outdated Homebrew check

We now skip the outdated check if our local origin/master tracking
branch matches the origin remote's current master. This prevents false
positives when we are actually up-to-date but the latest commit is over
24 hours old.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
  • Loading branch information...
1 parent 6837be6 commit 084e761f6abb5d9a9102767985dd5b1a54330b2b @jacknagel jacknagel committed Jun 3, 2012
Showing with 6 additions and 0 deletions.
  1. +6 −0 Library/Homebrew/cmd/doctor.rb
@@ -835,6 +835,12 @@ def check_for_bad_python_symlink
def check_for_outdated_homebrew
HOMEBREW_REPOSITORY.cd do
+ if File.directory? ".git"
+ local = `git rev-parse -q --verify refs/remotes/origin/master`.chomp
+ remote = /^([a-f0-9]{40})/.match(`git ls-remote origin refs/heads/master`)[0]
+ return if local == remote
+ end
+
timestamp = if File.directory? ".git"
`git log -1 --format="%ct" HEAD`.to_i
else

0 comments on commit 084e761

Please sign in to comment.