]> git.phdru.name Git - git-scripts.git/commitdiff
Test grep error code, not output
authorOleg Broytman <phd@phdru.name>
Mon, 9 Jan 2017 16:31:10 +0000 (19:31 +0300)
committerOleg Broytman <phd@phdru.name>
Mon, 9 Jan 2017 17:10:25 +0000 (20:10 +0300)
ls-not-pushed
ls-not-pushed-carefully

index 7e9bb4e59f172f61605966b9d1fb5e0273b4429b..bce8858e4e7bd9e155dd2649b0f0ddf73baa3af0 100755 (executable)
@@ -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"'
index 266e4cad675142c627edd96827d703c6817c3f5b..85fc57c27396fc30aa022e970ed098500fd753f0 100755 (executable)
@@ -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"'