diff --git a/bash_aliases b/bash_aliases index 266bd24..5a38eef 100755 --- a/bash_aliases +++ b/bash_aliases @@ -43,7 +43,7 @@ function prompt_ps1_git_branch() return fi current_branch=$(echo "$branch_out" | sed -re 's/(.no.branch.|[^ ]*).*/\1/') - ahead_behind=$(echo "$branch_out" | grep -E '(ahead|behind)' | sed -re 's/^.*(ahead|behind)(.[0-9]+).*$/\1\2/') + ahead_behind=$(echo "$branch_out" | grep -E '(ahead|behind)' | grep -Eo '(ahead|behind)[^]]*') if [[ "$ahead_behind" != "" ]]; then ahead_behind=": ${ahead_behind}" fi