update prompt_ps1_git_branch() to handle detached HEADs with git 1.8
This commit is contained in:
parent
5852b20e75
commit
adbe3fe704
@ -39,7 +39,7 @@ function prompt_ps1_git_branch()
|
|||||||
if [[ "$branch_out" == "" ]]; then
|
if [[ "$branch_out" == "" ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
re="^\\* (.no.branch.|[^ ]*)"
|
re="^\\* (.no.branch.|\\(detached[^)]*\\)|[^ ]*)"
|
||||||
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)[^]]*)\\]"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user