Skip to content

Git review cannot stage files with non-ASCII names because diff paths stay escaped #269

Description

@cristicretu

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

  1. Initialize a repository with a committed baseline and standard core.quotePath=true.
  2. Create an untracked file named café.txt.
  3. 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions