Skip to content

Commit 5297b08

Browse files
committed
Revert "Merge branch 'jt/archive-zip-deflate-fix' into next"
This reverts commit 4444b61, reversing changes made to 3e08bea.
1 parent 4a0f423 commit 5297b08

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

archive-zip.c

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -492,22 +492,14 @@ static int write_zip_entry(struct archiver_args *args,
492492

493493
zstream.next_in = buf;
494494
zstream.avail_in = 0;
495-
496-
do {
497-
result = git_deflate(&zstream, Z_FINISH);
498-
if (result != Z_OK && result != Z_STREAM_END)
499-
die("deflate error (%d)", result);
500-
501-
out_len = zstream.next_out - compressed;
502-
if (out_len > 0) {
503-
write_or_die(1, compressed, out_len);
504-
compressed_size += out_len;
505-
zstream.next_out = compressed;
506-
zstream.avail_out = sizeof(compressed);
507-
}
508-
} while (result != Z_STREAM_END);
495+
result = git_deflate(&zstream, Z_FINISH);
496+
if (result != Z_STREAM_END)
497+
die("deflate error (%d)", result);
509498

510499
git_deflate_end(&zstream);
500+
out_len = zstream.next_out - compressed;
501+
write_or_die(1, compressed, out_len);
502+
compressed_size += out_len;
511503
zip_offset += compressed_size;
512504

513505
write_zip_data_desc(size, compressed_size, crc);

0 commit comments

Comments
 (0)