From 5ccc965312be1a2fe3620b653041e529e9f79290 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 9 Jan 2017 19:31:10 +0300 Subject: [PATCH] Test grep error code, not output --- ls-not-pushed | 3 +-- ls-not-pushed-carefully | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ls-not-pushed b/ls-not-pushed index 7e9bb4e..bce8858 100755 --- a/ls-not-pushed +++ b/ls-not-pushed @@ -2,5 +2,4 @@ exec "`dirname \"$0\"`"/do-all \ 'test "$g" = "$d/.git" || continue; cd "$d" &&' \ - 'test -n "`git status --branch --short | grep "ahead\|behind"`" && - echo "$d"' + 'git status --branch --short | grep -q "ahead\|behind" && echo "$d"' diff --git a/ls-not-pushed-carefully b/ls-not-pushed-carefully index 266e4ca..85fc57c 100755 --- a/ls-not-pushed-carefully +++ b/ls-not-pushed-carefully @@ -10,5 +10,4 @@ rm -rf "$LSTMP" && mkdir "$LSTMP" && "$prog_dir"/do-all \ 'test "$g" = "$d/.git" || continue;' \ 'rsync -aW --del --protocol=28 "$d" "$LSTMP" && cd "$LSTMP/$b" &&' \ - 'test -n "`git status --branch --short | grep "ahead\|behind"`" && - echo "$d"' + 'git status --branch --short | grep -q "ahead\|behind" && echo "$d"' -- 2.39.5