[25/27] t5703: mask failing grep status
diff mbox series

Message ID d259d55656140a3c35c8585b093afac13a49e5c6.1573779466.git.liu.denton@gmail.com
State New
Headers show
  • t: general test cleanup + `set -o pipefail`
Related show

Commit Message

Denton Liu Nov. 15, 2019, 1:01 a.m. UTC
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@gmail.com>
 t/t5703-upload-pack-ref-in-want.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

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 () {