From df27f5b21f375daaf6ff614d2298914f9163a6e1 Mon Sep 17 00:00:00 2001 From: Haak Saxberg Date: Wed, 19 Mar 2014 10:23:56 -0700 Subject: [PATCH] compartmentalize git prompt a little more --- bash-files/bashrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bash-files/bashrc b/bash-files/bashrc index edae292..f89aee1 100644 --- a/bash-files/bashrc +++ b/bash-files/bashrc @@ -23,6 +23,8 @@ parse_git_branch() { diverge_pattern="# Your branch and (.*) have diverged" if [[ ! ${git_status} =~ "working directory clean" ]]; then state="${RED}!" + else + state="" fi # add an else if or two here if you want to get more specific if [[ ${git_status} =~ ${remote_pattern} ]]; then @@ -37,7 +39,7 @@ parse_git_branch() { fi if [[ ${git_status} =~ ${branch_pattern} ]]; then branch=${BASH_REMATCH[1]} - echo " $RED(${branch})${remote}${state} " + echo " $RED(${branch} ${remote}${state}) " fi }