3fca9c8933afc5c118a73cedb171a3c7b8e92730

Author
Carlo Sala <carlosalag@protonmail.com>
Committer
Carlo Sala <carlosalag@protonmail.com>
Date

Message

fix(upgrade): check if git is available and working

macOS seems to break dev tools when updating the system. This should
prevent the previous issues. See #11309

Closes #11420

Diff

 1diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
 2index cc527e72dcac8c61398a20e589f0f62ecfcd9ee2..3a6bb65555cbf41d5eb6eb35b2ccc88242d8b48e 100644
 3--- a/tools/check_for_upgrade.sh
 4+++ b/tools/check_for_upgrade.sh
 5@@ -24,7 +24,7 @@ zstyle -s ':omz:update' mode update_mode || {
 6 # - git is unavailable on the system.
 7 if [[ "$update_mode" = disabled ]] \
 8    || [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \
 9-   || ! command -v git &>/dev/null; then
10+   || ! command git --version 2>&1 >/dev/null; then
11   unset update_mode
12   return
13 fi