fix prompt_ps1_git_branch() to properly show current "branch" information while rebasing

This commit is contained in:
Josh Holtrop 2014-06-27 14:14:34 -04:00
parent 0933628f0e
commit e658839a68

View File

@ -19,7 +19,7 @@ function prompt_ps1_git_branch()
if [[ "$branch_out" == "" ]]; then if [[ "$branch_out" == "" ]]; then
return return
fi fi
re="^\\* (.no.branch.|\\(detached[^)]*\\)|[^ ]*)" re="^\\* (\\((detached|no.branch)[^)]*\\)|[^ ]*)"
if [[ "$branch_out" =~ $re ]]; then if [[ "$branch_out" =~ $re ]]; then
current_branch="${BASH_REMATCH[1]}" current_branch="${BASH_REMATCH[1]}"
re="((ahead|behind)[^]]*)\\]" re="((ahead|behind)[^]]*)\\]"