1
0
Fork 0

Show rev info when in detached HEAD

If you're in a detached HEAD state, it's not a symbolic ref, and so
`$branch` was left empty.
pull/1110/head
Hristos N. Triantafillou 9 years ago
parent 4f19700919
commit f6f767c78a

@ -215,7 +215,8 @@ function git-info {
fi
# Get the branch.
branch="${$(git symbolic-ref HEAD 2> /dev/null)#refs/heads/}"
branch="${$(git symbolic-ref HEAD 2> /dev/null)#refs/heads/}" \
|| branch="$(git rev-parse --short HEAD 2> /dev/null)"
# Format branch.
zstyle -s ':prezto:module:git:info:branch' format 'branch_format'

Loading…
Cancel
Save