fix(#2032): suppress macOS AppleDouble files in sandbox uploads#2040
Merged
Conversation
On macOS, bsdtar generates ._* companion files for any file with extended attributes (com.apple.quarantine, etc.). When UploadDir creates a tarball without suppressing this behavior, ._* files get baked into the archive. After the sandbox round-trip, these files land in .git/objects/pack/ and corrupt the git repository when git tries to parse them as pack indices. Changes: - UploadDir: set COPYFILE_DISABLE=1 in the tar command environment to prevent bsdtar from generating AppleDouble files. This env var is a no-op on Linux. - sanitizeDownload: remove ._* files inside .git/ directories as a defense-in-depth measure, catching any AppleDouble files that arrive via other transfer paths. - Add inGitDir helper to check if a path is inside a .git directory. - Add tests: fake-tar env capture for COPYFILE_DISABLE, AppleDouble removal in sanitizeDownload, and inGitDir unit tests. Note: pre-commit could not run (gitleaks Go install failed due to sandbox permission issues on /sandbox/go/pkg/mod/cache). go vet and go test passed. Closes #2032
Site previewPreview: https://1bb6b81b-site.fullsend-ai.workers.dev Commit: |
|
🤖 Review · Started 6:15 PM UTC |
ReviewFindingsLow
Info
|
|
🤖 Finished Review · ✅ Success · Started 6:15 PM UTC · Completed 6:20 PM UTC |
rh-hemartin
approved these changes
Jun 9, 2026
|
🤖 Finished Retro · ✅ Success · Started 8:46 AM UTC · Completed 8:51 AM UTC |
Retro: PR #2040 — suppress macOS AppleDouble files in sandbox uploadsWorkflow quality: Excellent. This was a clean, single-iteration workflow with no rework. Timeline
Assessment
Existing coverageThe one minor observation — the review agent using APPROVE verdict when findings are only pre-existing or informational — is already tracked by #2057. No new proposals warranted. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS, bsdtar generates .* companion files for any file with extended attributes (com.apple.quarantine, etc.). When UploadDir creates a tarball without suppressing this behavior, .* files get baked into the archive. After the sandbox round-trip, these files land in .git/objects/pack/ and corrupt the git repository when git tries to parse them as pack indices.
Changes:
to prevent bsdtar from generating AppleDouble files. This env var
is a no-op on Linux.
defense-in-depth measure, catching any AppleDouble files that
arrive via other transfer paths.
removal in sanitizeDownload, and inGitDir unit tests.
Note: pre-commit could not run (gitleaks Go install failed due to sandbox permission issues on /sandbox/go/pkg/mod/cache). go vet and go test passed.
Closes #2032
Post-script verification
agent/2032-macos-tar-appledouble)4cd660565f8abfc3bd1f0f697488a2e8e408101f..HEAD)