doctor: suggest to install git if the system one is outdated

Closes Homebrew/homebrew#42934.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
This commit is contained in:
Baptiste Fontaine 2015-08-14 09:30:53 +02:00
parent 5414597913
commit 3d7c38c736

View File

@ -862,11 +862,14 @@ class Checks
# https://help.github.com/articles/https-cloning-errors # https://help.github.com/articles/https-cloning-errors
`git --version`.chomp =~ /git version ((?:\d+\.?)+)/ `git --version`.chomp =~ /git version ((?:\d+\.?)+)/
if $1 && Version.new($1) < Version.new("1.7.10") then <<-EOS.undent if $1 && Version.new($1) < Version.new("1.7.10") then
An outdated version of Git was detected in your PATH. git_upgrade_cmd = Formula["git"].any_version_installed? ? "upgrade" : "install"
Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub.
Please upgrade: brew upgrade git <<-EOS.undent
EOS An outdated version of Git was detected in your PATH.
Git 1.7.10 or newer is required to perform checkouts over HTTPS from GitHub.
Please upgrade: brew #{git_upgrade_cmd} git
EOS
end end
end end