]> git.alrj.org Git - zsh.d.git/blobdiff - S60_git
Add a wrapper for mc to stay in current directory upon exit
[zsh.d.git] / S60_git
diff --git a/S60_git b/S60_git
index 256afc8c08ec9951e9cb3c1abfd52ad442937ea2..1061cf575a0a04d47412070ac157bdf7cc2b71fa 100644 (file)
--- 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