From 1dc7dbafa00224c85d820e456d0691c1e6074a2f Mon Sep 17 00:00:00 2001 From: hgmoll Date: Wed, 13 Jul 2016 18:07:31 +0200 Subject: [PATCH] Fix bash-git-prompt's gitstatus.sh A file can be staged AND unstaged at the same time --- gitstatus.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gitstatus.sh b/gitstatus.sh index c494878..8dcd49b 100755 --- a/gitstatus.sh +++ b/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"