Skip to content

Fix git status parser to handle paths with spaces and renames (#271)#272

Open
nickeddy wants to merge 1 commit into
warpdotdev:mainfrom
nickeddy:fix-command-signatures-271
Open

Fix git status parser to handle paths with spaces and renames (#271)#272
nickeddy wants to merge 1 commit into
warpdotdev:mainfrom
nickeddy:fix-command-signatures-271

Conversation

@nickeddy
Copy link
Copy Markdown

Switch files_for_staging to git status --short -z so paths arrive NUL-separated and unquoted, and parse each record by taking everything after the 3-byte XY status prefix instead of splitting on whitespace. This preserves filenames containing spaces, and the parser now skips the source record of rename (R) and copy (C) entries since only the destination exists on disk.

…tdev#271)

Switch `files_for_staging` to `git status --short -z` so paths arrive
NUL-separated and unquoted, and parse each record by taking everything
after the 3-byte `XY ` status prefix instead of splitting on whitespace.
This preserves filenames containing spaces, and the parser now skips the
source record of rename (`R`) and copy (`C`) entries since only the
destination exists on disk.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant