diff options
author | Leonid Volnitsky <Leonid@Volnitsky.com> | 2008-06-23 10:59:35 +0300 |
---|---|---|
committer | Leonid Volnitsky <Leonid@Volnitsky.com> | 2008-06-23 10:59:35 +0300 |
commit | db57df0918f6b1510eac732eb88e13a93ed12ce9 (patch) | |
tree | 45b0d105a6f241003235d915316a1c21d947b515 /prompt | |
parent | rfct: added local vars defs (diff) | |
download | git-prompt-db57df0918f6b1510eac732eb88e13a93ed12ce9.tar.gz git-prompt-db57df0918f6b1510eac732eb88e13a93ed12ce9.tar.bz2 git-prompt-db57df0918f6b1510eac732eb88e13a93ed12ce9.zip |
rfct: minor
Diffstat (limited to 'prompt')
-rwxr-xr-x | prompt | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -339,8 +339,11 @@ git_module() { branch=${branch/master/M} - grep -q "^ref:" $git_dir/HEAD 2>/dev/null || detached=detached - [[ -n "$detached" ]] && branch="<detached:`git-name-rev --name-only HEAD 2>/dev/null`>" + # if rawhex in .git/HEAD, then detached head + if ! grep -q "^ref:" $git_dir/HEAD 2>/dev/null; then + detached=detached + branch="<detached:`git-name-rev --name-only HEAD 2>/dev/null`>" + fi if [[ "$op" == "merge" ]] ; then branch="$op: $branch <~ $(git-name-rev --name-only $(<$git_dir/MERGE_HEAD))" @@ -379,7 +382,6 @@ git_module() { ### fringes (added depended on location) head_local="${head_local+$git_color $head_local\n}" tail_local="${tail_local+$git_color $tail_local}${dir_color}" - } ############################################################### PROMPT_COMMAND |