1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-25 17:20:25 +02:00

36725: vcs_info git: Compute %b correctly when rebasing detached heads.

This sets the %b expando to the hash of the before-the-merge HEAD, rather
than to the literal string "detached HEAD".  That hash is already available
via the gen-applied-string hook.
This commit is contained in:
Daniel Shahaf 2015-09-30 14:21:59 +00:00
parent 7ac34a3055
commit cd1cda9d57
2 changed files with 7 additions and 0 deletions

View file

@ -94,6 +94,10 @@ VCS_INFO_git_getbranch () {
elif [[ -d "${gitdir}/rebase-merge" ]] ; then
gitbranch="$(< ${gitdir}/rebase-merge/head-name)"
if [[ $gitbranch == 'detached HEAD' ]]; then
# get a sha1
gitbranch="$(< ${gitdir}/rebase-merge/orig-head)"
fi
elif [[ -d "${gitdir}/.dotest-merge" ]] ; then
gitbranch="$(< ${gitdir}/.dotest-merge/head-name)"