diff options
Diffstat (limited to 'zshfunc/vcs-info/VCS_INFO_git_getbranch')
-rw-r--r-- | zshfunc/vcs-info/VCS_INFO_git_getbranch | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/zshfunc/vcs-info/VCS_INFO_git_getbranch b/zshfunc/vcs-info/VCS_INFO_git_getbranch deleted file mode 100644 index 03c5fa5..0000000 --- a/zshfunc/vcs-info/VCS_INFO_git_getbranch +++ /dev/null @@ -1,35 +0,0 @@ -VCS_INFO_git_getbranch () { #{{{ - local gitbranch gitdir=$1 - local gitsymref='git symbolic-ref HEAD' - - if [[ -d "${gitdir}/rebase-apply" ]] \ - || [[ -d "${gitdir}/rebase" ]] \ - || [[ -d "${gitdir}/../.dotest" ]] \ - || [[ -f "${gitdir}/MERGE_HEAD" ]] ; then - gitbranch="$(${(z)gitsymref} 2> /dev/null)" - [[ -z ${gitbranch} ]] && [[ -r ${gitdir}/rebase-apply/head-name ]] \ - && gitbranch="$(< ${gitdir}/rebase-apply/head-name)" - - elif [[ -f "${gitdir}/rebase-merge/interactive" ]] \ - || [[ -d "${gitdir}/rebase-merge" ]] ; then - gitbranch="$(< ${gitdir}/rebase-merge/head-name)" - - elif [[ -f "${gitdir}/.dotest-merge/interactive" ]] \ - || [[ -d "${gitdir}/.dotest-merge" ]] ; then - gitbranch="$(< ${gitdir}/.dotest-merge/head-name)" - - else - gitbranch="$(${(z)gitsymref} 2> /dev/null)" - - if [[ $? -ne 0 ]] ; then - gitbranch="$(git describe --exact-match HEAD 2>/dev/null)" - - if [[ $? -ne 0 ]] ; then - gitbranch="${${"$(< $gitdir/HEAD)"}[1,7]}..." - fi - fi - fi - - printf '%s' "${gitbranch##refs/heads/}" - return 0 -} |