doctor: use Homebrew.git_origin

This commit is contained in:
Xu Cheng 2015-09-08 15:24:28 +08:00
parent 31ddce85e7
commit bff03ee5ba

View File

@ -916,10 +916,9 @@ class Checks
def check_git_origin def check_git_origin
return unless git? && (HOMEBREW_REPOSITORY/".git").exist? return unless git? && (HOMEBREW_REPOSITORY/".git").exist?
HOMEBREW_REPOSITORY.cd do origin = Homebrew.git_origin
origin = `git config --get remote.origin.url`.strip
if origin.empty? then <<-EOS.undent if origin.nil? then <<-EOS.undent
Missing git origin remote. Missing git origin remote.
Without a correctly configured origin, Homebrew won't update Without a correctly configured origin, Homebrew won't update
@ -927,7 +926,7 @@ class Checks
cd #{HOMEBREW_REPOSITORY} cd #{HOMEBREW_REPOSITORY}
git remote add origin https://github.com/Homebrew/homebrew.git git remote add origin https://github.com/Homebrew/homebrew.git
EOS EOS
elsif origin !~ /(mxcl|Homebrew)\/homebrew(\.git)?$/ then <<-EOS.undent elsif origin !~ /(mxcl|Homebrew)\/homebrew(\.git)?$/ then <<-EOS.undent
Suspicious git origin remote found. Suspicious git origin remote found.
With a non-standard origin, Homebrew won't pull updates from With a non-standard origin, Homebrew won't pull updates from
@ -938,7 +937,6 @@ class Checks
origin remote to point at the main repository, located at: origin remote to point at the main repository, located at:
https://github.com/Homebrew/homebrew.git https://github.com/Homebrew/homebrew.git
EOS EOS
end
end end
end end