doctor: Skip outdated check when offline

Fixes Homebrew/homebrew#13535.
This commit is contained in:
Misty De Meo 2012-07-22 12:26:56 -05:00
parent 17953f2b83
commit a8a16928e4

View File

@ -856,8 +856,10 @@ def check_for_outdated_homebrew
HOMEBREW_REPOSITORY.cd do HOMEBREW_REPOSITORY.cd do
if File.directory? ".git" if File.directory? ".git"
local = `git rev-parse -q --verify refs/remotes/origin/master`.chomp 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] remote = /^([a-f0-9]{40})/.match(`git ls-remote origin refs/heads/master 2>/dev/null`)
return if local == remote if remote.nil? || local == remote[0]
return
end
end end
timestamp = if File.directory? ".git" timestamp = if File.directory? ".git"