3 export __ZSH_GIT_BASEDIR=""
4 export __ZSH_GIT_BRANCH=""
5 export __ZSH_GIT_SUBDIR=""
6 export __ZSH_GIT_STATE=""
7 export __ZSH_GIT_VARS_INVALID=1
12 local git_dir ref base_dir sub_dir action branch
14 git_dir=$(git rev-parse --git-dir 2> /dev/null) || return
16 base_dir=${$(readlink -f "$git_dir/..")/$HOME/'~'}
18 sub_dir=$(git rev-parse --show-prefix)
20 ref=$(git symbolic-ref HEAD 2> /dev/null) || return
24 if [ -d "$git_dir/../.dotest" ]; then
25 if [ -f "$git_dir/../.dotest/rebasing" ]; then
27 elif [ -f "$git_dir/../.dotest/applying" ]; then
33 elif [ -f "$git_dir/.dotest-merge/interactive" ]; then
35 branch="$(cat "$git_dir/.dotest-merge/head-name")"
36 elif [ -d "$git_dir/.dotest-merge" ]; then
38 branch="$(cat "$git_dir/.dotest-merge/head-name")"
39 elif [ -f "$git_dir/MERGE_HEAD" ]; then
43 test -f "$git_dir/BISECT_LOG" && psvar[3]="bisect"
44 branch="$(git symbolic-ref HEAD 2>/dev/null)" || \
45 branch="$(git describe --exact-match HEAD 2>/dev/null)" || \
46 branch="$(cut -c1-7 "$git_dir/HEAD")..."
49 # Got here, we're in git
50 psvar[4]=${branch#refs/heads/}
55 precmd_functions+='git_parse'