compartmentalize git prompt a little more
This commit is contained in:
parent
2c4322e10b
commit
df27f5b21f
1 changed files with 3 additions and 1 deletions
|
|
@ -23,6 +23,8 @@ parse_git_branch() {
|
||||||
diverge_pattern="# Your branch and (.*) have diverged"
|
diverge_pattern="# Your branch and (.*) have diverged"
|
||||||
if [[ ! ${git_status} =~ "working directory clean" ]]; then
|
if [[ ! ${git_status} =~ "working directory clean" ]]; then
|
||||||
state="${RED}!"
|
state="${RED}!"
|
||||||
|
else
|
||||||
|
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
|
||||||
|
|
@ -37,7 +39,7 @@ parse_git_branch() {
|
||||||
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} "
|
echo " $RED(${branch} ${remote}${state}) "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue