diff options
| author | Daniel Shahaf <d.s@daniel.shahaf.name> | 2015-09-30 14:21:59 +0000 |
|---|---|---|
| committer | Daniel Shahaf <d.s@daniel.shahaf.name> | 2015-09-30 21:43:37 +0000 |
| commit | cd1cda9d57ff9f44d285bcd867721c4024500837 (patch) | |
| tree | 56ae927c1ce8043ede14690790f3beaed6eb2166 /Functions | |
| parent | 36725: vcs_info git: Compute %b correctly when merging to detached heads. (diff) | |
| download | zsh-cd1cda9d57ff9f44d285bcd867721c4024500837.tar zsh-cd1cda9d57ff9f44d285bcd867721c4024500837.tar.gz zsh-cd1cda9d57ff9f44d285bcd867721c4024500837.tar.bz2 zsh-cd1cda9d57ff9f44d285bcd867721c4024500837.tar.lz zsh-cd1cda9d57ff9f44d285bcd867721c4024500837.tar.xz zsh-cd1cda9d57ff9f44d285bcd867721c4024500837.tar.zst zsh-cd1cda9d57ff9f44d285bcd867721c4024500837.zip | |
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.
Diffstat (limited to 'Functions')
| -rw-r--r-- | Functions/VCS_Info/Backends/VCS_INFO_get_data_git | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git index 312f17c33..0a2a8bc37 100644 --- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git +++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git @@ -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)" |
