diff options
-rwxr-xr-x | prompt | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -319,8 +319,11 @@ PROMPT_COMMAND=' eval git_color="\${git_$status}" git_color=${git_color:-$WHITE} - ### head + ### branch head=`git-name-rev --name-only HEAD 2>/dev/null` + head_tail=`echo $head | sed 's/[^^~]*//'` # we cut head to leave only ^~, and reattach to branch name + branch=${branch/master/M}$head_tail + head_rev=`git-rev-parse HEAD 2>/dev/null` head_rev=${head_rev/HEAD/} head_rev=${head_rev:0:6} @@ -332,7 +335,7 @@ PROMPT_COMMAND=' file_list+="${git_modified_files+$git_modified$git_modified_files }" file_list+="${git_untracked_files+$git_untracked$git_untracked_files }" [[ $file_list ]] && file_list=":${file_list}" # ${+ does not works (?) - tail_local="(${head/master/m} $white$head_rev$git_color${op+ / $op}$git_color${file_list}$git_color)" + tail_local="(${branch} $white$head_rev$git_color${op+ / $op}$git_color${file_list}$git_color)" ### fringes (added depended on location) head_local="${head_local+$git_color $head_local\n}" |