diff options
| author | Baptiste Fontaine | 2015-08-14 09:30:53 +0200 |
|---|---|---|
| committer | Baptiste Fontaine | 2015-08-14 12:06:57 +0200 |
| commit | 3d7c38c7361ce98eb137af589bb6cfec4e2950e9 (patch) | |
| tree | 0b69affb2719456fb6adcacad163a3bf97351a66 | |
| parent | 541459791351a69b7b70047ee5e0c2c05797de92 (diff) | |
| download | brew-3d7c38c7361ce98eb137af589bb6cfec4e2950e9.tar.bz2 | |
doctor: suggest to install git if the system one is outdated
Closes Homebrew/homebrew#42934.
Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
| -rw-r--r-- | Library/Homebrew/cmd/doctor.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/doctor.rb b/Library/Homebrew/cmd/doctor.rb index 02e26e82b..ecf66f668 100644 --- a/Library/Homebrew/cmd/doctor.rb +++ b/Library/Homebrew/cmd/doctor.rb @@ -862,11 +862,14 @@ class Checks # https://help.github.com/articles/https-cloning-errors `git --version`.chomp =~ /git version ((?:\d+\.?)+)/ - if $1 && Version.new($1) < Version.new("1.7.10") then <<-EOS.undent - 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 upgrade git - EOS + if $1 && Version.new($1) < Version.new("1.7.10") then + git_upgrade_cmd = Formula["git"].any_version_installed? ? "upgrade" : "install" + + <<-EOS.undent + 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 |
