doctor: Skip outdated check when offline
Fixes Homebrew/homebrew#13535.
This commit is contained in:
parent
17953f2b83
commit
a8a16928e4
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user