From: Denton Liu Date: Fri, 15 Nov 2019 01:00:59 GMT Subject: [PATCH 12/27] t5317: use ! grep to check for no matching lines Message-ID: <52836aa59a84bf61781cd3501679011a36ac41e7.1573779465.git.liu.denton@gmail.com> In-Reply-To: Several times in t5317, we would use `wc -l` to ensure that a grep result is empty. However, grep already has a way to do that... Its return code! Use ! grep in the cases where we are ensuring that there are no matching lines. Signed-off-by: Denton Liu --- t/t5317-pack-objects-filter-objects.sh | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/t/t5317-pack-objects-filter-objects.sh b/t/t5317-pack-objects-filter-objects.sh index a8bbad74e2..dc0446574b 100755 --- a/t/t5317-pack-objects-filter-objects.sh +++ b/t/t5317-pack-objects-filter-objects.sh @@ -45,12 +45,7 @@ test_expect_success 'verify blob:none packfile has no blobs' ' git -C r1 index-pack ../filter.pack && git -C r1 verify-pack -v ../filter.pack >verify_result && - grep blob verify_result | - awk -f print_1.awk | - sort >observed && - - nr=$(wc -l verify_result && - grep blob verify_result | - awk -f print_1.awk | - sort >observed && - - nr=$(wc -l verify_result && - grep blob verify_result | - awk -f print_1.awk | - sort >observed && - - nr=$(wc -l