1
0
Fork 0

Git-plugin: Move file statuses count

Count file status in an external loop. git status shouldn't be used in a non porcelain mode
pull/40/head
Colin Hebert 13 years ago
parent 854c67ada4
commit 2bbbfa4de0

@ -273,7 +273,11 @@ function git-info() {
elif [[ "$branch_info[2]" == (#b)(?##) ]]; then elif [[ "$branch_info[2]" == (#b)(?##) ]]; then
branch="$match[1]" branch="$match[1]"
fi fi
else fi
done < <("${(z)status_cmd}" 2>/dev/null)
# Get current status.
while IFS=$'\n' read line; do
# Count added, deleted, modified, renamed, unmerged, untracked, dirty. # Count added, deleted, modified, renamed, unmerged, untracked, dirty.
# T (type change) is undocumented, see http://git.io/FnpMGw. # T (type change) is undocumented, see http://git.io/FnpMGw.
# For a table of scenarii, see http://i.imgur.com/2YLu1.png. # For a table of scenarii, see http://i.imgur.com/2YLu1.png.
@ -284,8 +288,7 @@ function git-info() {
[[ "$line" == (AA|DD|U?|?U)\ * ]] && (( unmerged++ )) [[ "$line" == (AA|DD|U?|?U)\ * ]] && (( unmerged++ ))
[[ "$line" == \?\?\ * ]] && (( untracked++ )) [[ "$line" == \?\?\ * ]] && (( untracked++ ))
(( dirty++ )) (( dirty++ ))
fi done < <(${(z)status_cmd} 2>/dev/null)
done < <("${(z)status_cmd}" 2>/dev/null)
# Format branch. # Format branch.
if [[ -n "$branch" ]]; then if [[ -n "$branch" ]]; then

Loading…
Cancel
Save