Repository navigation
fix: preserve worktree path bytes in porcelain parsing - #190
Merged
Merged
Conversation
andyrewlee
force-pushed
the
advisor/011-test-installer-signature-decisions
branch
from
September 26, 2026 12:11
5eb7828 to
f86b456
Compare
andyrewlee
force-pushed
the
advisor/012-preserve-worktree-path-bytes
branch
from
September 26, 2026 12:11
1e470a4 to
449656c
Compare
andyrewlee
force-pushed
the
advisor/011-test-installer-signature-decisions
branch
from
September 27, 2026 02:10
f86b456 to
a7743dd
Compare
andyrewlee
changed the base branch from
advisor/011-test-installer-signature-decisions
to
main
September 27, 2026 02:22
git worktree list --porcelain is line-framed, so a path containing a newline split into a truncated path plus forged worktree/HEAD records — corrupting the ownership map callers trust for navigation and removal. Use the NUL-terminated -z grammar (git >= 2.36) so path bytes survive losslessly, validate structural fields, and propagate parse errors. On a git that does not know -z, keep the line-based listing only after the worktrees/*/gitdir registrations prove no path carries CR/LF bytes; ambiguous repositories fail with an actionable error instead of a forged record set.
andyrewlee
force-pushed
the
advisor/012-preserve-worktree-path-bytes
branch
from
September 27, 2026 02:22
449656c to
5a8687e
Compare
Same constraint as the command-recording shim: Windows cannot exec an extensionless sh file, so the -z fallback tests silently never intercepted git (the shim log was never written and the real binary answered every call). Write git.cmd on Windows - os/exec runs it via cmd - parameterize the injected failure as message + exit code, and assert on normalized log lines.
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.
Summary
worktree list --porcelain -zso paths containing newlines/tabs/spaces round-trip exactly; legacy line output is strictly validated with a guarded fallback.Stacked on
advisor/011-test-installer-signature-decisions. Part of the advisor/NNN plan series; merge in stack order.Test plan
make ci) passed on this commit or an identical code tree (docs/design-only branches ran their validators + focused suites instead)