doctor: check git version
Checking out over HTTP/HTTPS from GitHub requires git 1.6.6, as GitHub only allows Smart HTTP transport. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
parent
0a49981a30
commit
d73df34bc6
@ -776,6 +776,28 @@ def check_for_leopard_ssl
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_git_version
|
||||||
|
# see https://github.com/blog/642-smart-http-support
|
||||||
|
return unless system "/usr/bin/which -s git"
|
||||||
|
`git --version`.chomp =~ /git version (\d)\.(\d)\.(\d)/
|
||||||
|
|
||||||
|
if $2.to_i > 6
|
||||||
|
return
|
||||||
|
elsif $2.to_i == 6 and $3.to_i == 6
|
||||||
|
return
|
||||||
|
else
|
||||||
|
puts <<-EOS.undent
|
||||||
|
An outdated version of Git was detected in your PATH.
|
||||||
|
|
||||||
|
Git 1.6.6 or newer is required to perform checkouts over HTTP from GitHub.
|
||||||
|
|
||||||
|
You may want to upgrade:
|
||||||
|
brew upgrade git
|
||||||
|
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
module Homebrew extend self
|
module Homebrew extend self
|
||||||
def doctor
|
def doctor
|
||||||
old_stdout = $stdout
|
old_stdout = $stdout
|
||||||
@ -820,6 +842,7 @@ module Homebrew extend self
|
|||||||
check_missing_deps
|
check_missing_deps
|
||||||
check_git_status
|
check_git_status
|
||||||
check_for_leopard_ssl
|
check_for_leopard_ssl
|
||||||
|
check_git_version
|
||||||
ensure
|
ensure
|
||||||
$stdout = old_stdout
|
$stdout = old_stdout
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user