1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-23 04:30:24 +02:00

37252: vcs_info git: Compute %b correctly with "rebase --onto" of detached heads. (Follow-up to 36725.)

This commit is contained in:
Daniel Shahaf 2015-11-30 03:23:57 +00:00
parent 4202c90b6d
commit 502d55c014
2 changed files with 6 additions and 1 deletions

View file

@ -87,7 +87,8 @@ VCS_INFO_git_getbranch () {
gitbranch="$(${(z)gitsymref} 2> /dev/null)"
[[ -z ${gitbranch} ]] && [[ -r ${actiondir}/head-name ]] \
&& gitbranch="$(< ${actiondir}/head-name)"
[[ -z ${gitbranch} ]] && gitbranch="$(< ${gitdir}/ORIG_HEAD)"
[[ -z ${gitbranch} || ${gitbranch} == 'detached HEAD' ]] \
&& gitbranch="$(< ${gitdir}/ORIG_HEAD)"
elif [[ -f "${gitdir}/MERGE_HEAD" ]] ; then
gitbranch="$(${(z)gitsymref} 2> /dev/null)"