From eed36fce38c406b548d53c56483e1d2e25c5c971 Mon Sep 17 00:00:00 2001 From: Shubham Mishra Date: Sat, 12 Mar 2022 11:51:26 +0530 Subject: t0030-t0050: avoid pipes with Git on LHS Pipes ignore error codes of LHS command and thus we should not use them with Git in tests. As an alternative, use a 'tmp' file to write the Git output so we can test the exit code. Signed-off-by: Shubham Mishra Signed-off-by: Junio C Hamano --- t/t0050-filesystem.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 't/t0050-filesystem.sh') diff --git a/t/t0050-filesystem.sh b/t/t0050-filesystem.sh index afc343cf9b..5c9dc90d0b 100755 --- a/t/t0050-filesystem.sh +++ b/t/t0050-filesystem.sh @@ -104,7 +104,8 @@ test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' ' rm camelcase && echo 1 >CamelCase && git add CamelCase && - camel=$(git ls-files | grep -i camelcase) && + git ls-files >tmp && + camel=$(grep -i camelcase tmp) && test $(echo "$camel" | wc -l) = 1 && test "z$(git cat-file blob :$camel)" = z1 ' -- cgit v1.2.3