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:
parent
7ac34a3055
commit
cd1cda9d57
@ -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.
|
||||
|
@ -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)"
|
||||
|
Loading…
Reference in New Issue
Block a user