Skip to content

fix(zip): keep inserting files after a directory entry - #99

Open
simpleqt wants to merge 1 commit into
mholt:mainfrom
simpleqt:fix/zip-insert-dir-continue
Open

simpleqt wants to merge 1 commit into
mholt:mainfrom
simpleqt:fix/zip-insert-dir-continue

Conversation

@simpleqt

Copy link
Copy Markdown

Zip.Insert returned nil after appending a directory entry, silently dropping every file listed after it: Insert(ctx, f, []FileInput{dir, a.txt, b.txt}) wrote only the directory and reported success (zip.go:359).

continue the loop instead. TestZip_InsertContinuesAfterDirectory inserts [start.txt, subdir/, after.txt] and asserts after.txt is present: it fails on master 9bf66b8 ("got [start.txt subdir/], want [start.txt subdir/ after.txt]") and passes with this change. The remaining failures in the package are the 3 pre-existing Windows symlink-privilege failures that fail identically on clean master.

Zip.Insert returned nil after inserting a directory entry, silently
dropping every file listed after it: Insert(ctx, f, [dir, a.txt,
b.txt]) wrote only the directory and reported success.

Continue the loop instead. Regression test: TestZip_InsertContinuesAfterDirectory
inserts [start.txt, subdir/, after.txt] into an archive and asserts after.txt
is present; it fails on 9bf66b8 ("got [start.txt subdir/], want [start.txt
subdir/ after.txt]") and passes with this change. The full zip test suite
reports only the 3 pre-existing Windows symlink-privilege failures that fail
identically on clean master (setupTestDir needs symlink rights).

Signed-off-by: simpleqt <2015900818@qq.com>
Copilot AI balanced review requested due to automatic review settings November 22, 2026 17:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants