spacing in git prompt

This commit is contained in:
Haak Saxberg 2014-03-19 10:31:14 -07:00
parent 354bb1f5a4
commit 1d2baa4784

View file

@ -22,24 +22,24 @@ parse_git_branch() {
remote_pattern="# Your branch is (.*) of" remote_pattern="# Your branch is (.*) of"
diverge_pattern="# Your branch and (.*) have diverged" diverge_pattern="# Your branch and (.*) have diverged"
if [[ ! ${git_status} =~ "nothing to commit" ]]; then if [[ ! ${git_status} =~ "nothing to commit" ]]; then
state="${RED}!" state=" ${RED}!"
else else
state="" state=""
fi fi
# add an else if or two here if you want to get more specific # add an else if or two here if you want to get more specific
if [[ ${git_status} =~ ${remote_pattern} ]]; then if [[ ${git_status} =~ ${remote_pattern} ]]; then
if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then if [[ ${BASH_REMATCH[1]} == "ahead" ]]; then
remote="${YELLOW}" remote=" ${YELLOW}"
else else
remote="${YELLOW}" remote=" ${YELLOW}"
fi fi
fi fi
if [[ ${git_status} =~ ${diverge_pattern} ]]; then if [[ ${git_status} =~ ${diverge_pattern} ]]; then
remote="${YELLOW}" remote=" ${YELLOW}"
fi fi
if [[ ${git_status} =~ ${branch_pattern} ]]; then if [[ ${git_status} =~ ${branch_pattern} ]]; then
branch=${BASH_REMATCH[1]} branch=${BASH_REMATCH[1]}
echo " $RED(${branch} ${remote}${state}$RED) " echo " $RED(${branch}${remote}${state}$RED) "
fi fi
} }