git worktree list --porcelain splits a path at an embedded newline, so is_worktree_registered treated a live checkout as unregistered. Task cleanup could then remove_dir_all that directory after a failed git worktree remove. NUL-delimited porcelain keeps the path in one field.
8 files changedLine totals unavailable