1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-27 06:22:20 +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

@ -1,5 +1,8 @@
2015-09-30 Daniel Shahaf <d.s@daniel.shahaf.name>
* 36725: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
vcs_info git: Compute %b correctly when rebasing detached heads.
* 36725: Functions/VCS_Info/Backends/VCS_INFO_get_data_git:
vcs_info git: Compute %b correctly when merging to detached
heads.

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)"