parseTar fails on large GitHub repositories tar files#82
Conversation
|
Tried using Opus and Claude Code to fix the issue and it did it! The problem was in the #parseBody() method where the parser wasn't handling the case when a file's content ended exactly at a buffer boundary. The fix adds a check to detect when #missing becomes 0 after consuming a buffer, which means the file body has been completely read. When this happens, it properly closes the body controller and calculates the padding bytes needed to align to the next 512-byte block boundary. |
|
Hi @remorses 👋 Thanks for the PR. Unfortunately I can't merge it here because I migrated all the code in this repo onto the If you're keen to get it merged, would you mind opening another PR over there? I'd really appreciate it! |
I added a test that fails with
Invalid tar header. Maybe the tar is corrupted or needs to be gunzipped?The returned GitHub tar should be correct, there must be an issue in how
tar-parsercomputes the checksums