From 64c6f733fb5665856ee95072edbb951096d08fda Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 18 Sep 2013 16:21:53 -0400 Subject: [PATCH] bash_aliases: prompt_ps1_git_branch(): minor fix in case commit comment contained a "]" character --- bash_aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_aliases b/bash_aliases index 7d5f686..6a089ad 100755 --- a/bash_aliases +++ b/bash_aliases @@ -42,7 +42,7 @@ function prompt_ps1_git_branch() re="^\\* (.no.branch.|[^ ]*)" if [[ "$branch_out" =~ $re ]]; then current_branch="${BASH_REMATCH[1]}" - re="((ahead|behind).*)\\]" + re="((ahead|behind)[^]]*)\\]" if [[ "$branch_out" =~ $re ]]; then current_branch="$current_branch: ${BASH_REMATCH[1]}" fi