prompt_ps1_git_branch: fix in case the words "ahead" or "behind" are in the commit comment
This commit is contained in:
parent
b9a7e85e0a
commit
1fcacd340e
@ -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)' | grep -Eo '(ahead|behind)[^]]*')
|
||||
ahead_behind=$(echo "$branch_out" | grep -E '(ahead|behind)' | grep -Eo '\[.*\]' | grep -Eo '(ahead|behind)[^]]*')
|
||||
if [[ "$ahead_behind" != "" ]]; then
|
||||
ahead_behind=": ${ahead_behind}"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user