aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-06-03 10:24:17 -0500
committerJack Nagel2012-06-03 10:32:40 -0500
commit084e761f6abb5d9a9102767985dd5b1a54330b2b (patch)
treec8704b9adf73ac491ab0471ff3f82dc65e306d56 /Library
parent6837be69a8163d508b54b947f74bff48ed7f9ac0 (diff)
downloadhomebrew-084e761f6abb5d9a9102767985dd5b1a54330b2b.tar.bz2
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>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/doctor.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index f76eef0b6..f22e57e92 100644
--- a/Library/Homebrew/cmd/doctor.rb
+++ b/Library/Homebrew/cmd/doctor.rb
@@ -835,6 +835,12 @@ end
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