fix: resolve a second issue where git -C <path> had to be used instead of git --work-tree <path>

This commit is contained in:
Andrea Alberti 2026-02-15 19:23:47 +01:00
parent 1107460bcd
commit 2e83176b23
No known key found for this signature in database

View file

@ -1967,13 +1967,13 @@ print -- "\nAvailable ice-modifiers:\n\n${ice_order[*]}"
# $1 - Absolute path to Git repository"
.zi-check-for-git-changes() {
+zi-log "{dbg} checking $1"
if command git --work-tree "$1" rev-parse --is-inside-work-tree &> /dev/null; then
if command git --work-tree "$1" rev-parse --abbrev-ref @'{u}' &> /dev/null; then
if command git -C "$1" rev-parse --is-inside-work-tree &> /dev/null; then
if command git -C "$1" rev-parse --abbrev-ref @'{u}' &> /dev/null; then
REPLY=$(command git -C "$1" rev-parse --abbrev-ref HEAD)
local nl=$'\n'
+zi-log -n "{pre}[self-update]{info} fetching latest changes from {obj}$REPLY{info} branch$nl{rst}"
command git -C "$1" fetch --quiet 2> /dev/null
local count="$(command git --work-tree "$1" rev-list --left-right --count HEAD...@'{u}' 2> /dev/null)"
local count="$(command git -C "$1" rev-list --left-right --count HEAD...@'{u}' 2> /dev/null)"
local down="$count[(w)2]"
if [[ $down -gt 0 ]]; then
return 0