The changes in 425a28e0a4 allow new files to show up in "git diff-files" (aka "changed but not staged") which is a problem because status code does not handle renaming in this case.
The main change to fix this is 6/7. The interesting corner case is in 7/7 where I decided to go with a middle ground, disabling only double renames. We have two other options to go: - unconditionally disable rename in wt_status_collect_changes_worktree which turns this 7-patch series into one patch - support double renames too but this may change porcelain output (or we have to add new output format). This could be done in a follow series if we want to. Nguyễn Thái Ngọc Duy (7): t2203: test status output with porcelain v2 format Use DIFF_DETECT_RENAME for detect_rename assignments wt-status.c: coding style fix wt-status.c: rename wt_status_change_data::score wt-status.c: catch unhandled diff status codes wt-status.c: handle worktree renames wt-status.c: avoid double renames in short/porcelain format builtin/commit.c | 2 +- diff.c | 2 +- t/t2203-add-intent.sh | 73 ++++++++++++++++++++++++++ wt-status.c | 141 ++++++++++++++++++++++++++++++++++++++++---------- wt-status.h | 4 +- 5 files changed, 191 insertions(+), 31 deletions(-) -- 2.15.0.320.g0453912d77