mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-21 18:46:06 +02:00
fix comments
This commit is contained in:
+18
-8
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user