summaryrefslogtreecommitdiff
path: root/t/t7008-grep-binary.sh
diff options
context:
space:
mode:
authorLars Schneider <larsxschneider@gmail.com>2016-02-17 08:57:46 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-17 19:10:43 (GMT)
commita0578e0382f453924fd2df8ea0402b90cd01f826 (patch)
treec81e621ddd52b6b3128039955cead43f17335d21 /t/t7008-grep-binary.sh
parent754884255bb580df159e58defa81cdd30b5c430c (diff)
downloadgit-a0578e0382f453924fd2df8ea0402b90cd01f826.zip
git-a0578e0382f453924fd2df8ea0402b90cd01f826.tar.gz
git-a0578e0382f453924fd2df8ea0402b90cd01f826.tar.bz2
t: do not hide Git's exit code in tests using 'nul_to_q'
Git should not be on the left-hand side of a pipe, because it hides the exit code, and we want to make sure git does not fail. Fix all invocations of 'nul_to_q' (defined in /t/test-lib-functions.sh) using this pattern. There is one more occurrence of the pattern in t9010-svn-fe.sh which is too evolved to change it easily. All remaining test code that does not adhere to the pattern can be found with the following command: git grep -E 'git.*[^|]\|($|[^|])' Helped-by: Jeff King <peff@peff.net> Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7008-grep-binary.sh')
-rwxr-xr-xt/t7008-grep-binary.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t7008-grep-binary.sh b/t/t7008-grep-binary.sh
index b146406..9c9c378 100755
--- a/t/t7008-grep-binary.sh
+++ b/t/t7008-grep-binary.sh
@@ -141,7 +141,8 @@ test_expect_success 'grep respects not-binary diff attribute' '
test_cmp expect actual &&
echo "b diff" >.gitattributes &&
echo "b:binQary" >expect &&
- git grep bin b | nul_to_q >actual &&
+ git grep bin b >actual.raw &&
+ nul_to_q <actual.raw >actual &&
test_cmp expect actual
'