X-Git-Url: https://git.alrj.org/?p=zsh.d.git;a=blobdiff_plain;f=S60_git;h=1061cf575a0a04d47412070ac157bdf7cc2b71fa;hp=256afc8c08ec9951e9cb3c1abfd52ad442937ea2;hb=HEAD;hpb=24e74f7cd9e63583edcc3facf253bf439202319f diff --git a/S60_git b/S60_git index 256afc8..1061cf5 100644 --- a/S60_git +++ b/S60_git @@ -14,6 +14,7 @@ __ZSH_GIT_STATUS_INVALID=1 git_chpwd() { # On cd, invalidate git status in prompt __ZSH_GIT_VARS_INVALID=1 + __ZSH_GIT_BASEDIR="" } @@ -33,20 +34,20 @@ git_get_status() { # 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