Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit 084e761f6abb5d9a9102767985dd5b1a54330b2b 1 parent 6837be6
Jack Nagel authored June 03, 2012

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  Library/Homebrew/cmd/doctor.rb
6  Library/Homebrew/cmd/doctor.rb
@@ -835,6 +835,12 @@ def check_for_bad_python_symlink
835 835
 
836 836
 def check_for_outdated_homebrew
837 837
   HOMEBREW_REPOSITORY.cd do
  838
+    if File.directory? ".git"
  839
+      local = `git rev-parse -q --verify refs/remotes/origin/master`.chomp
  840
+      remote = /^([a-f0-9]{40})/.match(`git ls-remote origin refs/heads/master`)[0]
  841
+      return if local == remote
  842
+    end
  843
+
838 844
     timestamp = if File.directory? ".git"
839 845
       `git log -1 --format="%ct" HEAD`.to_i
840 846
     else

0 notes on commit 084e761

Please sign in to comment.
Something went wrong with that request. Please try again.