update prompt_ps1_git_branch() to handle detached HEADs with git 1.8

This commit is contained in:
josh committed 2013-12-30 10:48:58 -05:00
1 parent 5852b20e75
commit adbe3fe704
1 file changed
+1 -1
+1 -1
View File
@@ -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)[^]]*)\\]"