Fix bash-git-prompt's gitstatus.sh

A file can be staged AND unstaged at the same time
master
hgmoll 10 years ago
parent 85a2752f71
commit 1dc7dbafa0
  1. 7
      gitstatus.sh

@ -28,10 +28,11 @@ while IFS='' read -r line || [[ -n "$line" ]]; do
status=${line:0:2}
case "$status" in
\#\#) branch_line="${line/\.\.\./^}" ;;
?M) ((num_changed++)) ;;
?D) ((num_changed++)) ;;
U?) ((num_conflicts++)) ;;
?M) ((num_changed++)) ;;&
?D) ((num_changed++)) ;;&
U?) ((num_conflicts++)) ;;&
\?\?) ((num_untracked++)) ;;
\ ?) ;;
*) ((num_staged++)) ;;
esac
done <<< "$gitstatus"

Loading…
Cancel
Save