Repository navigation
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
The following comment was made by an LLM, it may be inaccurate: |
There was a problem hiding this comment.
Looks good. I verified it with a wrapper that makes git reject --sparse with exit 129, the way older Git does. On the base, the batching regression test then fails with 137 spawned Git processes for 40 files. With this PR it passes, and so does the rest of test/vcs.test.ts. With an unmodified Git (2.47.3), test/vcs.test.ts passes on both base and PR, and typecheck in packages/core passes.
The PR now returns early when git add fails for a reason other than 129. Before, the exit code was ignored. When a listed file has disappeared, for example, Git exits 128 and writes nothing, so the base already ended up in the per-file fallback anyway. This just skips two wasted git diff runs.
One question about the description, not a blocker: Git 2.47 accepts add --sparse, so Apple Git 2.50.1 almost certainly does too. Was the exit 129 maybe from a different, older git earlier in your PATH? The fix is still correct for Git versions without the option.
Public API: unchanged (internal Git invocation only).
Related: #52953
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 72-hour window. Feel free to open a new pull request that follows our guidelines. |
Summary
git add --sparsewhen the installed Git rejects that option.Evidence
git add --sparseexits 129 (unknown option 'sparse'). The batch then silently fell back to per-file commands, spawning 137 Git processes for 40 untracked files.Verification
bun script/test.ts --test-name-pattern 'batches untracked files without spawning Git per file or touching the index'— pass.bun run typecheckinpackages/core— pass.bun script/test.tsinpackages/core— 6,646 pass, 43 skip, 0 fail.Added by the opencode bot (AI-generated).
Related: #52953