From adbe3fe704a48f9ac0ea22181943152172e3e0a7 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 30 Dec 2013 10:48:58 -0500 Subject: [PATCH] update prompt_ps1_git_branch() to handle detached HEADs with git 1.8 --- bash_aliases | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bash_aliases b/bash_aliases index 6d43383..70009e2 100755 --- a/bash_aliases +++ b/bash_aliases @@ -39,7 +39,7 @@ function prompt_ps1_git_branch() if [[ "$branch_out" == "" ]]; then return fi - re="^\\* (.no.branch.|[^ ]*)" + re="^\\* (.no.branch.|\\(detached[^)]*\\)|[^ ]*)" if [[ "$branch_out" =~ $re ]]; then current_branch="${BASH_REMATCH[1]}" re="((ahead|behind)[^]]*)\\]"