diff options
author | Pratik Karki <predatoramigo@gmail.com> | 2018-03-27 23:16:37 +0545 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-28 09:30:14 -0700 |
commit | a4d4e32a700df92ca576ce89110c075b8ce6da75 (patch) | |
tree | 4f991815ba071fc8849314f248018d1054a7ef99 /t/t5300-pack-object.sh | |
parent | d32eb83c1db7d0a8bb54fe743c6d1dd674d372c5 (diff) | |
download | git-a4d4e32a700df92ca576ce89110c075b8ce6da75.tar.gz |
test: avoid pipes in git related commands for testpk/test-avoid-pipe-hiding-exit-status
Avoid using pipes downstream of Git commands since the exit codes
of commands upstream of pipes get swallowed, thus potentially
hiding failure of those commands. Instead, capture Git command
output to a file and apply the downstream command(s) to that file.
Signed-off-by: Pratik Karki <predatoramigo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5300-pack-object.sh')
-rwxr-xr-x | t/t5300-pack-object.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh index 9c68b99251..156beb2d52 100755 --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@ -311,8 +311,8 @@ test_expect_success 'unpacking with --strict' ' rm -f .git/index && tail -n 10 LIST | git update-index --index-info && ST=$(git write-tree) && - PACK5=$( git rev-list --objects "$LIST" "$LI" "$ST" | \ - git pack-objects test-5 ) && + git rev-list --objects "$LIST" "$LI" "$ST" >actual && + PACK5=$( git pack-objects test-5 <actual ) && PACK6=$( ( echo "$LIST" echo "$LI" @@ -358,8 +358,8 @@ test_expect_success 'index-pack with --strict' ' rm -f .git/index && tail -n 10 LIST | git update-index --index-info && ST=$(git write-tree) && - PACK5=$( git rev-list --objects "$LIST" "$LI" "$ST" | \ - git pack-objects test-5 ) && + git rev-list --objects "$LIST" "$LI" "$ST" >actual && + PACK5=$( git pack-objects test-5 <actual ) && PACK6=$( ( echo "$LIST" echo "$LI" |