Skip to content

Commit 6012799

Browse files
avargitster
authored andcommitted
archive tests: use a cheaper "zipinfo -h" invocation to get header
Change an invocation of zipinfo added in 19ee294 (t5004: test ZIP archives with many entries, 2015-08-22) to simply ask zipinfo for the header info, rather than spewing out info about the entire archive and race to kill it with SIGPIPE due to the downstream "head -2". I ran across this because I'm adding a "set -o pipefail" test mode. This won't be needed for the version of the mode that I'm introducing (which currently relies on a patch to GNU bash), but I think this is a good idea anyway. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9aebc47 commit 6012799

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

t/t5004-archive-corner-cases.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ test_expect_success ZIPINFO 'zip archive with many entries' '
153153
154154
# check the number of entries in the ZIP file directory
155155
expr 65536 + 256 >expect &&
156-
"$ZIPINFO" many.zip | head -2 | sed -n "2s/.* //p" >actual &&
156+
"$ZIPINFO" -h many.zip >zipinfo &&
157+
sed -n "2s/.* //p" <zipinfo >actual &&
157158
test_cmp expect actual
158159
'
159160

0 commit comments

Comments
 (0)