From be207fd5f3665c8299158853d7b5913c046e52cf Mon Sep 17 00:00:00 2001 From: Leonid Volnitsky Date: Sat, 7 Jul 2012 09:17:50 +0300 Subject: substitute branch name "master" for "M" only if it starts with "master" --- git-prompt.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/git-prompt.sh b/git-prompt.sh index a206eaa..2853909 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -422,7 +422,6 @@ parse_git_status() { vcs=git ########################################################## GIT STATUS - file_regex='\([^/ ]*\/\{0,1\}\).*' added_files=() modified_files=() untracked_files=() @@ -509,7 +508,7 @@ parse_git_status() { fi #### branch - branch=${branch/master/M} + branch=${branch/#master/M} # another method of above: # branch=$(git symbolic-ref -q HEAD || { echo -n "detached:" ; git name-rev --name-only HEAD 2>/dev/null; } ) -- cgit v1.2.3