diff --git a/plugins/git/functions/git-info b/plugins/git/functions/git-info index 0b139820..d0602856 100644 --- a/plugins/git/functions/git-info +++ b/plugins/git/functions/git-info @@ -274,11 +274,13 @@ function git-info() { 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++ )) + # T (type change) is undocumented, see http://git.io/FnpMGw. + # For a table of scenarii, see http://i.imgur.com/2YLu1.png. + [[ "$line" == ([ACDMT][\ MT]|[ACMT]D)\ * ]] && (( added++ )) + [[ "$line" == [\ ACMRT]D\ * ]] && (( deleted++ )) + [[ "$line" == ?[MT]\ * ]] && (( modified++ )) + [[ "$line" == R?\ * ]] && (( renamed++ )) + [[ "$line" == (AA|DD|U?|?U)\ * ]] && (( unmerged++ )) [[ "$line" == \?\?\ * ]] && (( untracked++ )) (( dirty++ )) fi