[PATCH 25/27] t5703: mask failing grep status

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In a future patch, we plan on running tests with `set -o pipefail`.
However, since grep can return failure in the case that no lines are
matched, this can trigger a failure in a pipe in the case where grep is
being used as a filter.

Use test_grep_return_success() instead of grep so that we don't fail
even if we have no matching lines.

Signed-off-by: Denton Liu <liu.denton@xxxxxxxxx>
---
 t/t5703-upload-pack-ref-in-want.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh
index 9f6d837720..c4f9698398 100755
--- a/t/t5703-upload-pack-ref-in-want.sh
+++ b/t/t5703-upload-pack-ref-in-want.sh
@@ -19,7 +19,7 @@ get_actual_commits () {
 		}' <out | test-tool pkt-line unpack-sideband >o.pack &&
 	git index-pack o.pack &&
 	git verify-pack -v o.idx >objs &&
-	grep commit objs | cut -c-40 | sort >actual_commits
+	test_grep_return_success commit objs | cut -c-40 | sort >actual_commits
 }
 
 check_output () {
-- 
2.24.0.399.gf8350c9437




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux