diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-09-01 16:31:24 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-01 16:31:24 -0700 |
commit | 565f575791f34e9e0f8d45c4762e5ec4c44cc993 (patch) | |
tree | 80e2e2e7766cd829b8fd225ce58b2e9e75e9d90a /t | |
parent | bb84dceb045febd5320f6810db1fb00b17348ab1 (diff) | |
parent | 88329ca8091b16f4bb01e3ea546c8c5e1a5016ec (diff) | |
download | git-565f575791f34e9e0f8d45c4762e5ec4c44cc993.tar.gz |
Merge branch 'rs/archive-zip-many'
"git archive" did not use zip64 extension when creating an archive
with more than 64k entries, which nobody should need, right ;-)?
* rs/archive-zip-many:
archive-zip: support more than 65535 entries
archive-zip: use a local variable to store the creator version
t5004: test ZIP archives with many entries
Diffstat (limited to 't')
-rwxr-xr-x | t/t5004-archive-corner-cases.sh | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/t/t5004-archive-corner-cases.sh b/t/t5004-archive-corner-cases.sh index 654addaae3..cca23383c5 100755 --- a/t/t5004-archive-corner-cases.sh +++ b/t/t5004-archive-corner-cases.sh @@ -115,4 +115,44 @@ test_expect_success 'archive empty subtree by direct pathspec' ' check_dir extract sub ' +ZIPINFO=zipinfo + +test_lazy_prereq ZIPINFO ' + n=$("$ZIPINFO" "$TEST_DIRECTORY"/t5004/empty.zip | sed -n "2s/.* //p") + test "x$n" = "x0" +' + +test_expect_success ZIPINFO 'zip archive with many entries' ' + # add a directory with 256 files + mkdir 00 && + for a in 0 1 2 3 4 5 6 7 8 9 a b c d e f + do + for b in 0 1 2 3 4 5 6 7 8 9 a b c d e f + do + : >00/$a$b + done + done && + git add 00 && + git commit -m "256 files in 1 directory" && + + # duplicate it to get 65536 files in 256 directories + subtree=$(git write-tree --prefix=00/) && + for c in 0 1 2 3 4 5 6 7 8 9 a b c d e f + do + for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f + do + echo "040000 tree $subtree $c$d" + done + done >tree && + tree=$(git mktree <tree) && + + # zip them + git archive -o many.zip $tree && + + # check the number of entries in the ZIP file directory + expr 65536 + 256 >expect && + "$ZIPINFO" many.zip | head -2 | sed -n "2s/.* //p" >actual && + test_cmp expect actual +' + test_done |