update: tweak git too old check.

Avoid trying to install and warning if system Git is too old but Git
is already installed.
This commit is contained in:
Mike McQuaid 2018-02-27 10:41:16 +00:00
parent 8ee2d0983c
commit 430bb7c3a0

View File

@ -390,12 +390,14 @@ EOS
brew install curl
fi
if [[ -n "$HOMEBREW_SYSTEM_GIT_TOO_OLD" ]] || ! git --version >/dev/null 2>&1
if ! git --version &>/dev/null ||
[[ -n "$HOMEBREW_SYSTEM_GIT_TOO_OLD" &&
! -x "$HOMEBREW_PREFIX/opt/git/bin/git" ]]
then
# we cannot install brewed git if homebrew/core is unavailable.
[[ -d "$HOMEBREW_LIBRARY/Taps/homebrew/homebrew-core" ]] && brew install git
unset GIT_EXECUTABLE
if ! git --version >/dev/null 2>&1
if ! git --version &>/dev/null
then
odie "Git must be installed and in your PATH!"
fi