From 5503965b01dc20e855c1daf86c74b1554c159078 Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Thu, 8 Mar 2012 21:58:03 +0000 Subject: [PATCH] Git-plugin: Update the status parsing Respect the rules set in http://linux.die.net/man/1/git-status --- plugins/git/functions/git-info | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/git/functions/git-info b/plugins/git/functions/git-info index 8e551aeb..dc4010bb 100644 --- a/plugins/git/functions/git-info +++ b/plugins/git/functions/git-info @@ -278,12 +278,12 @@ function git-info() { branch="$match[1]" fi else - # Count added, deleted, modified, renamed, unmerged, untracked, dirty. - [[ "$line" == (((A|M|D|T) )|(AD|AM|AT|MM))\ * ]] && (( added++ )) - [[ "$line" == ( D|AD)\ * ]] && (( deleted++ )) - [[ "$line" == (( (M|T))|(AM|AT|MM))\ * ]] && (( modified++ )) - [[ "$line" == R\ \ * ]] && (( renamed++ )) - [[ "$line" == UU\ * ]] && (( unmerged++ )) + # Count: added/deleted/modified/renamed/unmerged/untracked + [[ "$line" == (A|M|D|C)[MD\ ]\ * ]] && (( added++ )) + [[ "$line" == [\ MARC]D\ * ]] && (( deleted++ )) + [[ "$line" == ?M\ * ]] && (( modified++ )) + [[ "$line" == R?\ * ]] && (( renamed++ )) + [[ "$line" == (?U|U?|AA|DD)\ * ]] && (( unmerged++ )) [[ "$line" == \?\?\ * ]] && (( untracked++ )) (( dirty++ )) fi