From 65bea86ae9df1b58d88ad32e7338b1d1c8ca4e0e Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sun, 3 Jun 2012 10:24:17 -0500 Subject: [PATCH] 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 --- Library/Homebrew/cmd/doctor.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index f76eef0b66..f22e57e92a 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