This commit is contained in:
Matthew Boston 2025-12-17 20:50:26 +01:00 committed by GitHub
commit a288418574
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -474,9 +474,12 @@ __git_ps1 ()
if [ -n "$b" ]; then
:
# Prefer symbolic-ref short name resolution (works well with worktrees)
elif symref_short="$(git symbolic-ref --quiet --short HEAD 2>/dev/null)" && [ -n "$symref_short" ]; then
b="$symref_short"
elif [ -h "$g/HEAD" ]; then
# symlink symbolic ref
b="$(git symbolic-ref HEAD 2>/dev/null)"
b="$(git symbolic-ref --short HEAD 2>/dev/null)"
else
local head=""
if ! __git_eread "$g/HEAD" head; then