From f10a421d3fd0986caae2d2cac5629c19a03771a1 Mon Sep 17 00:00:00 2001 From: nojhan Date: Sat, 28 Apr 2012 10:38:20 +0200 Subject: [PATCH] use the current branch for checking if there is pending commits --- .bashrc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.bashrc b/.bashrc index 740c3c3..8ef6106 100644 --- a/.bashrc +++ b/.bashrc @@ -104,11 +104,12 @@ git_branch_color() color="" if git diff --quiet 2>/dev/null >&2 ; then - has_commit=`git rev-list origin/master..master` - if [ "$has_commit" == "" ] ; then - color="${green}" # nothing to commit or push - else + branch=$(git_branch) + has_commit=`git rev-list origin/$branch..$branch` + if [ "$has_commit" != "" ] ; then color="${yellow}" # some commits to push + else + color="${green}" # nothing to commit or push fi else color="${red}" # changes to commit