fix(tia): detect renames in both porcelain status columns (#2017)

* fix(tia): detect renames in both porcelain status columns

git status --porcelain emits worktree renames as " R new\0old". The parser only checked the first status column, so the paired source path was read as a standalone record and truncated by substr(3). The broken path then made git check-ignore exit 128, which surfaced as MissingDependency("Tia mode", "git").

* Fix worktree rename test style

---------

Co-authored-by: Punyapal Shah <53343069+MrPunyapal@users.noreply.github.com>
Co-authored-by: Punyapal Shah <mrpunyapal@gmail.com>
This commit is contained in:
Cy(rod) John
2026-11-13 22:48:16 +08:00
committed by GitHub
parent 8e3f467d8a
commit 1fbd63dbb3
2 changed files with 27 additions and 1 deletions
+1 -1
View File
@@ -359,7 +359,7 @@ final readonly class ChangedFiles
$status = substr($record, 0, 2);
$path = substr($record, 3);
if ($status[0] === 'R' || $status[0] === 'C') {
if (str_contains($status, 'R') || str_contains($status, 'C')) {
$files[] = $path;
if (isset($records[$i + 1]) && $records[$i + 1] !== '') {