mirror of
https://github.com/dcarrillo/prezto.git
synced 2024-12-22 21:58:00 +00:00
[Fix #37] Improve Git status parsing
This commit is contained in:
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…
Reference in New Issue
Block a user