Skip to content

Read a path with spaces from a patch section that has only a header - #1547

Open
JaynouOliver wants to merge 1 commit into
devdotfast:mainfrom
JaynouOliver:fix/patch-header-paths-with-spaces
Open

JaynouOliver wants to merge 1 commit into
devdotfast:mainfrom
JaynouOliver:fix/patch-header-paths-with-spaces

Conversation

@JaynouOliver

Copy link
Copy Markdown

splitGitPatchFiles falls back to the diff --git header when a section has no --- / +++ lines: a binary file, a mode-only change, or an empty file added or deleted. Git does not quote a space there and the header was split on whitespace, so diff --git a/docs/Screen Shot 1.png b/docs/Screen Shot 1.png gave the path Shot.

Outside a rename both sides name the same path, so the header is now split at its middle first, and tokenized as before when the halves differ.

Tested with pnpm --filter @dev.fast/local-vcs test: the new test fails without the change (1 failed) and the package passes with it (80 passed | 5 skipped).

Not verified: the full pnpm run ci, jj, a running Desktop. No issue exists for this.

@JaynouOliver
JaynouOliver marked this pull request as ready for review November 14, 2026 23:01
Git does not quote a space in the `diff --git` header, and the header
was split on whitespace. A binary file, a mode-only change or an empty
file added or deleted has no `---` / `+++` lines to fall back on, so
`a/docs/Screen Shot 1.png b/docs/Screen Shot 1.png` came back as the
path `Shot`.

Outside a rename both sides name the same path, so the header is split
at its middle first and tokenized as before when the halves differ.
@JaynouOliver
JaynouOliver force-pushed the fix/patch-header-paths-with-spaces branch from 140a9ee to f152c5c Compare November 17, 2026 05:33

This branch has not been deployed

No deployments
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.

1 participant