diff options
author | Shubham Mishra <shivam828787@gmail.com> | 2022-03-12 07:21:26 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-13 01:22:04 +0100 |
commit | eed36fce38c406b548d53c56483e1d2e25c5c971 (patch) | |
tree | d03ba431dcb3f6c7fbde5457e374b3d773e749bd /t/t0050-filesystem.sh | |
parent | t0001-t0028: avoid pipes with Git on LHS (diff) | |
download | git-eed36fce38c406b548d53c56483e1d2e25c5c971.tar.xz git-eed36fce38c406b548d53c56483e1d2e25c5c971.zip |
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 <shivam828787@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to '')
-rwxr-xr-x | t/t0050-filesystem.sh | 3 |
1 files changed, 2 insertions, 1 deletions
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 ' |