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.
This commit is contained in:
parent
4f19700919
commit
f6f767c78a
1 changed files with 2 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue