From: Amand Tihon Date: Thu, 18 Dec 2014 10:14:34 +0000 (+0100) Subject: Update git status parsing. X-Git-Url: https://git.alrj.org/?p=zsh.d.git;a=commitdiff_plain;h=d5db4c03a16a9f4624583ca62fde48f7578ca544 Update git status parsing. --- diff --git a/S60_git b/S60_git index 78c163c..1061cf5 100644 --- a/S60_git +++ b/S60_git @@ -34,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