From 9a73fd795453b874efe7da629d6954ba05774503 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 22 Feb 2021 14:12:52 +0300 Subject: [PATCH] Feat(ls-not-pushed): Improve regular expression Lower probability of false positives. --- ls-not-pushed | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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` -- 2.39.5