Update minimum Git version.

This forces the use of Homebrew's Git on El Capitan and below.
Normally I'd remove the need for this but given we're weeks away from
El Capitan being unsupported it doesn't seem worth the effort to remove
useful functionality. Instead, let's warn about an old Git and
autoinstall Homebrew's Git wherever needed.

Fixes #4818.
This commit is contained in:
Mike McQuaid 2018-09-06 12:38:20 +01:00
parent 6c3547e5aa
commit 25b4d94b5c
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
2 changed files with 6 additions and 8 deletions

View File

@ -96,10 +96,8 @@ then
HOMEBREW_FORCE_BREWED_CURL="1"
fi
# The system Git is too old for some GitHub's SSL ciphers on older
# macOS versions.
# https://github.com/blog/2507-weak-cryptographic-standards-removed
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "100900" ]]
# The system Git is too old for some Homebrew functionality we rely on.
if [[ "$HOMEBREW_MACOS_VERSION_NUMERIC" -lt "101200" ]]
then
HOMEBREW_FORCE_BREWED_GIT="1"
fi

View File

@ -559,16 +559,16 @@ module Homebrew
end
def check_git_version
# https://help.github.com/articles/https-cloning-errors
# System Git version on macOS Sierra.
minimum_version = "2.14.3".freeze
return unless Utils.git_available?
return unless Version.create(Utils.git_version) < Version.create("1.8.5")
return if Version.create(Utils.git_version) >= Version.create(minimum_version)
git = Formula["git"]
git_upgrade_cmd = git.any_version_installed? ? "upgrade" : "install"
<<~EOS
An outdated version (#{Utils.git_version}) of Git was detected in your PATH.
Git 1.8.5 or newer is required to perform checkouts over HTTPS from GitHub and
to support the 'git -C <path>' option.
Git #{minimum_version} or newer is required for Homebrew.
Please upgrade:
brew #{git_upgrade_cmd} git
EOS