1
0
Fork 0

[Fix #37] Improve Git status parsing

pull/40/head
Colin Hebert 13 years ago committed by Sorin Ionescu
parent cdb95f810f
commit 7d08a49432

@ -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

Loading…
Cancel
Save