From e378fd36a36ea2dfa46ed8c51268a70c575ae91d Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Thu, 15 Mar 2012 11:43:53 +0000 Subject: [PATCH] Git-plugin: Fix regex No need to use a pipe in a "[]" and no need to use a group match when only one character is used. --- plugins/git/functions/git-info | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/git/functions/git-info b/plugins/git/functions/git-info index 00cfc451..08e8955b 100644 --- a/plugins/git/functions/git-info +++ b/plugins/git/functions/git-info @@ -280,9 +280,9 @@ function git-info() { else # Count: added/deleted/modified/renamed/unmerged/untracked # T (type change) is undocumented, see https://raw.github.com/gitster/git/master/Documentation/RelNotes/1.7.8.2.txt - [[ "$line" == (A|M|D|C|T)[MD\ ]\ * ]] && (( added++ )) + [[ "$line" == [AMDCT][MD\ ]\ * ]] && (( added++ )) [[ "$line" == [\ MARC]D\ * ]] && (( deleted++ )) - [[ "$line" == ?[M|T]\ * ]] && (( modified++ )) + [[ "$line" == ?[MT]\ * ]] && (( modified++ )) [[ "$line" == R?\ * ]] && (( renamed++ )) [[ "$line" == (?U|U?|AA|DD)\ * ]] && (( unmerged++ )) [[ "$line" == \?\?\ * ]] && (( untracked++ ))