compartmentalize git prompt a little more

This commit is contained in:
Haak Saxberg 2014-03-19 10:23:56 -07:00
parent 2c4322e10b
commit df27f5b21f

View file

@ -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
}