zshrc: Handle a state of git in vcs_info(), when a normal rebase conflicts
authorFrank Terbeck <ft@grml.org>
Wed, 27 Aug 2008 11:00:35 +0000 (13:00 +0200)
committerFrank Terbeck <ft@grml.org>
Wed, 27 Aug 2008 11:00:35 +0000 (13:00 +0200)
This should have been handled before, but didn't due to a bug.
I just ran into this state for the first time.

etc/zsh/zshrc

index 1c38fcd..7a33c2d 100644 (file)
@@ -1101,7 +1101,7 @@ VCS_INFO_git_getaction () { #{{{
             else
                 gitaction="am/rebase"
             fi
-            print '%s' ${gitaction}
+            printf '%s' ${gitaction}
             return 0
         fi
     done
@@ -1142,6 +1142,7 @@ VCS_INFO_git_getbranch () { #{{{
        || [[ -d "${gitdir}/../.dotest" ]]   \
        || [[ -f "${gitdir}/MERGE_HEAD" ]] ; then
         gitbranch="$(${(z)gitsymref} 2> /dev/null)"
+        [[ -z ${gitbranch} ]] && gitbranch="$(< ${gitdir}/rebase-apply/head-name)"
 
     elif   [[ -f "${gitdir}/rebase-merge/interactive" ]] \
         || [[ -d "${gitdir}/rebase-merge" ]] ; then