[PATCH 25/27] t5703: mask failing grep status
- From
Denton Liu <liu.denton@gmail.com>
- Date
- Nov 15, 2019, 01:01 UTC
- Message-ID
- <d259d55656140a3c35c8585b093afac13a49e5c6.1573779466.git.liu.denton@gmail.com>
- In-Reply-To
- <cover.1573779465.git.liu.denton@gmail.com>
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 --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