aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew
diff options
context:
space:
mode:
authorMisty De Meo2012-07-22 12:26:56 -0500
committerMisty De Meo2012-07-22 12:57:03 -0500
commita8a16928e4e7f77a8f2d73d9dd2fef9d8383fc2a (patch)
treee00cf0223c9f277f58b60b90efdfeffb8858ece8 /Library/Homebrew
parent17953f2b83ba764c5cd5dc679d98c82fb6cc4b77 (diff)
downloadbrew-a8a16928e4e7f77a8f2d73d9dd2fef9d8383fc2a.tar.bz2
doctor: Skip outdated check when offline
Fixes Homebrew/homebrew#13535.
Diffstat (limited to 'Library/Homebrew')
-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"