about summary refs log tree commit diff
path: root/Functions/VCS_Info/Backends
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2015-11-30 03:23:57 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2015-11-30 03:42:47 +0000
commit502d55c01494fabd1d98c67aab0a9746d59b715a (patch)
tree35225c1da69b4b790c6fb0a5da9ffcfad35c6597 /Functions/VCS_Info/Backends
parent4202c90b6d6f1f08cdaf56180f589a00395c32be (diff)
downloadzsh-502d55c01494fabd1d98c67aab0a9746d59b715a.tar.gz
zsh-502d55c01494fabd1d98c67aab0a9746d59b715a.tar.xz
zsh-502d55c01494fabd1d98c67aab0a9746d59b715a.zip
37252: vcs_info git: Compute %b correctly with "rebase --onto" of detached heads. (Follow-up to 36725.)
Diffstat (limited to 'Functions/VCS_Info/Backends')
-rw-r--r--Functions/VCS_Info/Backends/VCS_INFO_get_data_git3
1 files changed, 2 insertions, 1 deletions
diff --git a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
index 704c1890e..e1cee7439 100644
--- a/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
+++ b/Functions/VCS_Info/Backends/VCS_INFO_get_data_git
@@ -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)"