The diff parser preserves Git's C-style filename escapes instead of decoding them. The per-file Git actions then receive a path that does not exist.
Reproduction
- Initialize a repository with a committed baseline and standard
core.quotePath=true.
- Create an untracked file named
café.txt.
- Open Working changes and click the file's Stage action.
Reproduced result
An isolated Rust harness imported the unchanged diff.rs and git_review.rs from main and called load_local_diff(root, DiffLayer::Working), then passed the resulting file path to GitRepository::stage_paths.
parsed path: "caf\\303\\251.txt"
stage result: fatal: pathspec 'caf\303\251.txt' did not match any files
expected path: "café.txt"
The path-equality regression assertion failed. All Git mutations were confined to disposable fixture repositories.
Cause and impact
This also gives file opening and quoted diff evidence the wrong filename. Whole-hunk patch bytes are retained separately; this report specifically concerns decoded file identity and file-scoped actions.
Expected behavior
Parse Git-quoted path bytes faithfully and preserve the actual repository-relative filename. Simply disabling core.quotePath does not solve quotes, tabs, or backslashes in filenames.
Add integration cases for a non-ASCII filename, quoted/backslash characters, and whitespace; assert both the parsed path and successful per-file staging.
Validated against main 1196d89 with an isolated Cargo harness using production modules. No product files were modified.
The diff parser preserves Git's C-style filename escapes instead of decoding them. The per-file Git actions then receive a path that does not exist.
Reproduction
core.quotePath=true.café.txt.Reproduced result
An isolated Rust harness imported the unchanged
diff.rsandgit_review.rsfrom main and calledload_local_diff(root, DiffLayer::Working), then passed the resulting file path toGitRepository::stage_paths.The path-equality regression assertion failed. All Git mutations were confined to disposable fixture repositories.
Cause and impact
DiffFile.path.This also gives file opening and quoted diff evidence the wrong filename. Whole-hunk patch bytes are retained separately; this report specifically concerns decoded file identity and file-scoped actions.
Expected behavior
Parse Git-quoted path bytes faithfully and preserve the actual repository-relative filename. Simply disabling
core.quotePathdoes not solve quotes, tabs, or backslashes in filenames.Add integration cases for a non-ASCII filename, quoted/backslash characters, and whitespace; assert both the parsed path and successful per-file staging.
Validated against main
1196d89with an isolated Cargo harness using production modules. No product files were modified.