git_chpwd() {
# On cd, invalidate git status in prompt
__ZSH_GIT_VARS_INVALID=1
+ __ZSH_GIT_BASEDIR=""
}
# Return only git status
local gitstat gitstatus
- gitstat=$(git status 2> /dev/null | grep '\(# Untracked\|# Changes\|# Changed but not updated:\)')
+ gitstat=$(LANG=C git status 2> /dev/null | grep '\(Untracked\|Changes\|Changed but not updated:\)')
# 'fix for mcedit parser
gitstatus=""
- if [[ $(echo ${gitstat} | grep -c "^# Changes to be committed:$") > 0 ]]; then
+ if [[ $(echo ${gitstat} | grep -c "^Changes to be committed:$") > 0 ]]; then
gitstatus='✚'
fi
- if [[ $(echo ${gitstat} | grep -c "^\# Changed but not updated:$") > 0 || \
- $(echo ${gitstat} | grep -c "^\# Changes not staged for commit:$") > 0 ]]; then
+ if [[ $(echo ${gitstat} | grep -c "^Changed but not updated:$") > 0 || \
+ $(echo ${gitstat} | grep -c "^Changes not staged for commit:$") > 0 ]]; then
gitstatus="${gitstatus}✹"
fi
- if [[ $(echo ${gitstat} | grep -c "^# Untracked files:$") > 0 ]]; then
+ if [[ $(echo ${gitstat} | grep -c "^Untracked files:$") > 0 ]]; then
gitstatus="${gitstatus}★"
fi