1
0
Fork 0
mirror of synced 2024-12-26 16:03:21 -05:00
zimfw/modules/git/functions/parse_git_dirty
KoharaKazuya b23f7ec6d9 [prompt] fix gitster local var
separate declaration and initialization of local array variable

Closes #21
2016-01-12 09:03:21 -05:00

17 lines
526 B
Text

# slightly modified parse_git_dirty from oh-my-zsh for theme compatibility
# not supporting git < 1.7.2; upgrade your shit
local STATUS=''
local FLAGS
FLAGS=('--porcelain' '--ignore-submodules=dirty')
if [[ ${zgit_hide_prompt} != 'true' ]]; then
if [[ "${zgit_disable_untracked_dirty}" == "true" ]]; then
FLAGS+='--untracked-files=no'
fi
STATUS=$(command git status ${FLAGS} 2> /dev/null | tail -n1)
fi
if [[ -n ${STATUS} ]]; then
print ${ZSH_THEME_GIT_PROMPT_DIRTY}
else
print ${ZSH_THEME_GIT_PROMPT_CLEAN}
fi