fix comments

This commit is contained in:
Carlo Sala
2026-09-18 14:17:05 +02:00
parent 97dfe1ae54
commit 59d7ef3171
+18 -8
View File
@@ -138,14 +138,24 @@ _omz_git_head() {
if [[ "$head" = ref:\ * ]]; then if [[ "$head" = ref:\ * ]]; then
ref="${head#ref: }" ref="${head#ref: }"
if [[ -r "$common/$ref" ]]; then case "$ref" in
read -r REPLY 2>/dev/null < "$common/$ref" || return 1 # These namespaces are private to each worktree and are never resolved
elif [[ -r "$common/packed-refs" ]]; then # from the common directory or its packed-refs file.
lines=("${(@f)$(<"$common/packed-refs")}") refs/bisect/*|refs/worktree/*|refs/rewritten/*)
REPLY="${lines[(r)* ${(b)ref}]%% *}" [[ -r "$gitdir/$ref" ]] || return 1
else read -r REPLY 2>/dev/null < "$gitdir/$ref" || return 1
return 1 ;;
fi *)
if [[ -r "$common/$ref" ]]; then
read -r REPLY 2>/dev/null < "$common/$ref" || return 1
elif [[ -r "$common/packed-refs" ]]; then
lines=("${(@f)$(<"$common/packed-refs")}")
REPLY="${lines[(r)* ${(b)ref}]%% *}"
else
return 1
fi
;;
esac
else else
# detached HEAD: the file holds the commit itself # detached HEAD: the file holds the commit itself
REPLY="$head" REPLY="$head"