Git status hides the source of a rename that leaves the workspace from the worktree side
What happened?
split_by_workspace in crates/app-server/src/runtime_api/git.rs projects repository-root rows into the workspace frame. When a rename leaves the workspace, it synthesizes a deleted row so the source is still visible inside the workspace, but the guard for that is row.index == "R".
Since #7310 the parser also returns a worktree-side rename, whose index column is a space. For that shape the guard is false, so the source path — which really has disappeared from the workspace — appears in no row of GET /v1/git or GET /v1/changes at all. The index-side equivalent shows a deleted row.
Steps to reproduce
git init -q -b main r && cd r
mkdir sub && echo one > sub/a.txt
git add . && git commit -qm init
git mv sub/a.txt outside.txt
git reset -q
git add -N outside.txt
git status --porcelain=v1 -z | od -c # " R outside.txt\0sub/a.txt\0"
ls sub/a.txt # gone from the worktree
git ls-files sub # still sub/a.txt in the index
Open the workspace at sub/ and request GET /v1/git or GET /v1/changes. detail.files is empty: a.txt is not listed, although it no longer exists in the workspace. With git mv sub/a.txt outside.txt and no reset, the same request returns one row for a.txt with index = "D", status = "deleted".
Expected
The source is listed as a deletion in both cases. The column the change actually lives in differs, so the synthesized row should say so: a worktree-side rename deletes in the worktree (worktree = "D", staged = false), and the index-side row keeps index = "D", staged = true.
Staging safety is not weakened by the gap — the outside row still carries its root-relative old_path and compute_tokens covers it — so this is a listing gap, not a guard gap.
C should not synthesize a row at all: copying in either column leaves the source in place. Git reports a worktree copy as A in the first place (-c status.renames=copies still emits A b.txt), so that half is defensive only.
Version
main at f5a3dda97 (0.10.3 source).
Attribution
🤖 Generated by SpikeBot 000(CodeWhale-LOCAL)