Repository navigation
fix(git): parse worktree-side status renames - #4190
Conversation
worktrunk-bot
left a comment
There was a problem hiding this comment.
Outside this diff, parse_working_tree_status in src/commands/list/collect/tasks.rs carries the same first-column-only assumption: if index_status == 'R' { has_renamed = true; }, with 'R' in neither of the matches! arms above it. A R entry therefore sets no flag at all and WorkingTreeStatus::is_dirty() comes back false, so a worktree whose only change is a worktree-side rename renders as clean in wt list:
$ mv a.txt b.txt && git add -N b.txt
$ git status --porcelain
R a.txt -> b.txt
$ wt list --format json | jq -c '.items[0].worktree.changes'
{"staged":false,"modified":false,"untracked":false,"renamed":false,"deleted":false,"conflicted":false,...}That one is display-only — the removal and merge gates go through WorkingTree::is_dirty, which is a non-empty check over the raw porcelain, so no safety check is reading the flags.
Happy to push the flag mapping as a commit here, or leave it for a follow-up PR — whichever you'd prefer, given the request to keep this one narrow.
0.79.0 was prepared and merged in #4181 but never tagged, so it never shipped. Cargo.toml and Cargo.lock already carry the version, so this reuses it and folds the thirteen commits that landed since into the same changelog section. New entries cover the worktree-side rename fixes (#4190, #4191), the per-project unknown-field warning (#4123), and the unterminated code fence in the picker's preview (#4183, combined with #4178's column fix). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Summary
RandCin either porcelain status column as two-path records.This is the small, independent parser fix extracted from #4112 after the request to split that PR.
Verification
cargo test --lib worktree_renamecargo run -- hook pre-merge --yes(4,932 passed, 1 expected skipped)