From a8a16928e4e7f77a8f2d73d9dd2fef9d8383fc2a Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Sun, 22 Jul 2012 12:26:56 -0500 Subject: [PATCH] doctor: Skip outdated check when offline Fixes Homebrew/homebrew#13535. --- Library/Homebrew/cmd/doctor.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 6e9796a70f..e510b7e844 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -856,8 +856,10 @@ 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 + remote = /^([a-f0-9]{40})/.match(`git ls-remote origin refs/heads/master 2>/dev/null`) + if remote.nil? || local == remote[0] + return + end end timestamp = if File.directory? ".git"