#! /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`