summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarc Cornellà <hello@mcornella.com>2021-11-10 11:21:59 +0100
committerMarc Cornellà <hello@mcornella.com>2021-11-10 11:21:59 +0100
commite3f7b8aa570a09186a7e3d1877b36d7e43d39197 (patch)
treeefa0496c4cdb3e84449da6f4cc174a60ef15b7f5 /tools
parentdb19589fcf03690a443f1a206361963b47809b93 (diff)
downloadzsh-e3f7b8aa570a09186a7e3d1877b36d7e43d39197.tar.gz
zsh-e3f7b8aa570a09186a7e3d1877b36d7e43d39197.tar.bz2
zsh-e3f7b8aa570a09186a7e3d1877b36d7e43d39197.zip
fix(updater): avoid `git -C` for compatibility with git < v1.8.5 (#10404)
Fixes #10404
Diffstat (limited to 'tools')
-rw-r--r--tools/check_for_upgrade.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh
index 70cd21f84..a6fdf4659 100644
--- a/tools/check_for_upgrade.sh
+++ b/tools/check_for_upgrade.sh
@@ -34,11 +34,11 @@ function current_epoch() {
function is_update_available() {
local branch
- branch=${"$(git -C "$ZSH" config --local oh-my-zsh.branch)":-master}
+ branch=${"$(cd "$ZSH"; git config --local oh-my-zsh.branch)":-master}
local remote remote_url remote_repo
- remote=${"$(git -C "$ZSH" config --local oh-my-zsh.remote)":-origin}
- remote_url=$(git -C "$ZSH" config remote.$remote.url)
+ remote=${"$(cd "$ZSH"; git config --local oh-my-zsh.remote)":-origin}
+ remote_url=$(cd "$ZSH"; git config remote.$remote.url)
local repo
case "$remote_url" in
@@ -56,7 +56,7 @@ function is_update_available() {
# Get local HEAD. If this fails assume there are updates
local local_head
- local_head=$(git -C "$ZSH" rev-parse $branch 2>/dev/null) || return 0
+ local_head=$(cd "$ZSH"; git rev-parse $branch 2>/dev/null) || return 0
# Get remote HEAD. If no suitable command is found assume there are updates
# On any other error, skip the update (connection may be down)