fix the state part of the git prompt
This commit is contained in:
parent
df27f5b21f
commit
354bb1f5a4
1 changed files with 2 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ parse_git_branch() {
|
||||||
branch_pattern="^# On branch ([^${IFS}]*)"
|
branch_pattern="^# On branch ([^${IFS}]*)"
|
||||||
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} =~ "working directory clean" ]]; then
|
if [[ ! ${git_status} =~ "nothing to commit" ]]; then
|
||||||
state="${RED}!"
|
state="${RED}!"
|
||||||
else
|
else
|
||||||
state=""
|
state=""
|
||||||
|
|
@ -39,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}$RED) "
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue