mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-18 10:22:00 +00:00
fix(updater): avoid git -C
for compatibility with git < v1.8.5 (#10404)
Fixes #10404
This commit is contained in:
parent
db19589fcf
commit
e3f7b8aa57
1 changed files with 4 additions and 4 deletions
|
@ -34,11 +34,11 @@ function current_epoch() {
|
||||||
|
|
||||||
function is_update_available() {
|
function is_update_available() {
|
||||||
local branch
|
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
|
local remote remote_url remote_repo
|
||||||
remote=${"$(git -C "$ZSH" config --local oh-my-zsh.remote)":-origin}
|
remote=${"$(cd "$ZSH"; git config --local oh-my-zsh.remote)":-origin}
|
||||||
remote_url=$(git -C "$ZSH" config remote.$remote.url)
|
remote_url=$(cd "$ZSH"; git config remote.$remote.url)
|
||||||
|
|
||||||
local repo
|
local repo
|
||||||
case "$remote_url" in
|
case "$remote_url" in
|
||||||
|
@ -56,7 +56,7 @@ function is_update_available() {
|
||||||
|
|
||||||
# Get local HEAD. If this fails assume there are updates
|
# Get local HEAD. If this fails assume there are updates
|
||||||
local local_head
|
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
|
# Get remote HEAD. If no suitable command is found assume there are updates
|
||||||
# On any other error, skip the update (connection may be down)
|
# On any other error, skip the update (connection may be down)
|
||||||
|
|
Loading…
Reference in a new issue