diff options
author | JuanPablo <jpabloaj@gmail.com> | 2011-06-26 18:26:33 -0400 |
---|---|---|
committer | Leonid Volnitsky <Leonid@Volnitsky.com> | 2011-07-01 09:17:49 +0300 |
commit | d6a18a480d09a45edc114c8235ebd9ffb4491cd4 (patch) | |
tree | 12d5f25562d6c132cab6337ff61955533d84d8d1 | |
parent | begin monitoring of remotes branchs (diff) | |
download | git-prompt-d6a18a480d09a45edc114c8235ebd9ffb4491cd4.tar.gz git-prompt-d6a18a480d09a45edc114c8235ebd9ffb4491cd4.tar.bz2 git-prompt-d6a18a480d09a45edc114c8235ebd9ffb4491cd4.zip |
when remote is origin show o:
-rwxr-xr-x | git-prompt.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/git-prompt.sh b/git-prompt.sh index 7743927..d6306bf 100755 --- a/git-prompt.sh +++ b/git-prompt.sh @@ -524,8 +524,13 @@ parse_git_status() { fi fi if [[ $(git branch -a | grep $remote) != "" ]]; then - if [[ -f $git_dir/FETCH_HEAD && $(git log --oneline HEAD..$remote/master) != "" ]]; then - remotes+=" "$remote:$(git log --oneline HEAD..$remote/master | wc -l) + nRemoteCommit=$(git log --oneline HEAD..$remote/master | wc -l) + if [[ -f $git_dir/FETCH_HEAD && $nRemoteCommit != "0" ]]; then + if [[ $remote == "origin" ]]; then + remotes+=" o:"$nRemoteCommit + else + remotes+=" "$remote:$nRemoteCommit + fi fi else git fetch $remote >& /dev/null & |