Skip to content

Driver crashes keeping the tree when an attempt created a non-ASCII-named file (git add -N on a quoted path) #3616

Backlog

Description

@clabonte

Symptom

A work unit whose attempt is refused by a guard (retain_on_guard_refusal keeping the tree) crashes the driver with CalledProcessError when the attempt created a new file whose name contains a non-ASCII character (for example docs/café.md).

Cause

retain_tree_after_refusal (specfuse/loop/loop.py) marks the attempt's new files intent-to-add (git add -N -- <paths>, #3538). The paths come from untracked_paths(), which reads git ls-files --others --exclude-standard without -z. With git's default core.quotePath=true, a non-ASCII name comes back C-quoted ("caf\303\251.md", quotes included), so git add -N gets a pathspec that matches nothing and exits 128.

Repro

git init -q r && cd r
git -c user.email=t@example.com -c user.name=t commit -q --allow-empty -m init
echo x > café.md
git ls-files --others --exclude-standard          # prints "caf\303\251.md"
git add -N -- "$(git ls-files --others --exclude-standard)"
# fatal: pathspec '"caf\303\251.md"' did not match any files

In the loop: an attempt writes a new non-ASCII-named file and is refused by produces_not_in_diff / deliverable_missing / no_deliverable_files with the tree kept, and loop.run() raises.

Scope

Found by a close probe during FEAT-LOOP-2026-0251, but it predates that feature: the pre-feature loop.py raises the same error from the same function. Other callers that parse git ls-files / git diff --name-only output without -z (untracked_paths, ignored_paths, git_diff_names) likely mis-handle the same names. They would compare or act on quoted names, not crash.

Fix shape

Read names NUL-separated (-z) in untracked_paths (and its siblings), as _paths_differing_from now does on the FEAT-LOOP-2026-0251 branch. Test: a kept-tree guard refusal whose attempt created a non-ASCII-named file does not crash, and the file is intent-to-add afterwards.

Activity

  1. added
    bug
    on Nov 26, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions