aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMisty De Meo2012-07-22 12:26:56 -0500
committerMisty De Meo2012-07-22 12:57:03 -0500
commit68caf03faaea291196387e0efdd352648b0f2070 (patch)
tree8689ccd29bf21425afd6bfed460c2e7406f9aa12 /Library/Homebrew/cmd
parent9c1e7cb9aaca19c6e649601069023f775d2c188d (diff)
downloadhomebrew-68caf03faaea291196387e0efdd352648b0f2070.tar.bz2
doctor: Skip outdated check when offline
Fixes #13535.
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/doctor.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb
index 6e9796a70..e510b7e84 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"