prompt bugfix: show git branch name in yellow iff there is pending commits to push
This commit is contained in:
parent
e73dfca9ef
commit
1a56aae1af
1 changed files with 4 additions and 3 deletions
7
.bashrc
7
.bashrc
|
|
@ -95,10 +95,11 @@ git_branch_color()
|
|||
|
||||
color=""
|
||||
if git diff --quiet 2>/dev/null >&2 ; then
|
||||
if git rev-list --quiet origin/master..master 2>&1 >/dev/null ; then
|
||||
color="${yellow}" # some commits to push
|
||||
else
|
||||
has_commit=`git rev-list origin/master..master`
|
||||
if [ "$has_commit" == "" ] ; then
|
||||
color="${green}" # nothing to commit or push
|
||||
else
|
||||
color="${yellow}" # some commits to push
|
||||
fi
|
||||
else
|
||||
color="${red}" # changes to commit
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue