aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2018-02-27 10:41:16 +0000
committerMike McQuaid2018-02-27 10:41:16 +0000
commit430bb7c3a0688100370272d240891391f3bb915c (patch)
tree9998734384212edab3f7fa0da8fe0d75fc896622
parent8ee2d0983c924951f1c66a2464da7f70792127c5 (diff)
downloadbrew-430bb7c3a0688100370272d240891391f3bb915c.tar.bz2
update: tweak git too old check.
Avoid trying to install and warning if system Git is too old but Git is already installed.
-rw-r--r--Library/Homebrew/cmd/update.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index cc7a86cf3..3f287340f 100644
--- a/Library/Homebrew/cmd/update.sh
+++ b/Library/Homebrew/cmd/update.sh
@@ -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