Fix git capsule fallback when __git_ps1 is empty
This commit is contained in:
@@ -169,7 +169,11 @@ __git_capsule() {
|
||||
if declare -F __git_ps1 >/dev/null 2>&1; then
|
||||
has_ps1=1
|
||||
info="$(__git_ps1 "%s" 2>/dev/null)"
|
||||
else
|
||||
if [[ -z "$info" ]]; then
|
||||
has_ps1=0
|
||||
fi
|
||||
fi
|
||||
if [[ -z "$info" ]]; then
|
||||
if command -v git >/dev/null 2>&1; then
|
||||
info="$(git symbolic-ref --quiet --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null)"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user