Skip to content
Snippets Groups Projects
Commit d73df34b authored by Jack Nagel's avatar Jack Nagel
Browse files

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: default avatarJack Nagel <jacknagel@gmail.com>
parent 0a49981a
No related branches found
No related tags found
No related merge requests found
......@@ -776,6 +776,28 @@ def check_for_leopard_ssl
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
def doctor
old_stdout = $stdout
......@@ -820,6 +842,7 @@ module Homebrew extend self
check_missing_deps
check_git_status
check_for_leopard_ssl
check_git_version
ensure
$stdout = old_stdout
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment