X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=ls-not-pushed;h=4cbd831713773fad4b39c3cd8ec6c939bffb0bd7;hb=0ffabe9869f780b215500fe0c9f4caf4e79a7107;hp=8966c5928735b8a69b92ad9d8d866f8031b7ad38;hpb=fb46679b2a74d34a3ef0c1d98f56ada1b2aa8647;p=git-scripts.git diff --git a/ls-not-pushed b/ls-not-pushed index 8966c59..4cbd831 100755 --- a/ls-not-pushed +++ b/ls-not-pushed @@ -1,5 +1,5 @@ #! /bin/sh -if git branch --verbose | grep -q "ahead\|behind"; then +if git branch --verbose | grep -q "\(ahead\|behind\) [0-9]"; then up=`git rev-parse --abbrev-ref @{u} 2>/dev/null` if [ -n "$up" -a "$up" != "@{u}" ]; then set -- `git rev-list --count --left-right @{u}...HEAD`