Repository navigation
Report removal failures with the surviving checkout and branch state - #4457
Conversation
worktrunk-bot
left a comment
There was a problem hiding this comment.
The new "not empty" gate on the remaining-entries listing makes code-coverage fail. integration_tests::git_error_display::worktree_errors_render drops the Remaining in directory: target/ line from its removal left one entry case, and that case is a permission-denied failure. Before accepting the new snapshot, consider whether hiding the listing there is intended. Details are inline.
worktrunk-bot
left a comment
There was a problem hiding this comment.
codecov/patch fails on this head at 86.2%. The 19 missed lines are the new map_err in Repository::remove_worktree and the relocated list_remaining_entries (src/git/repository/worktrees.rs). On main the old handler-side wrapper was covered by remove_continues_dirty_foreground. That refusal now comes from staging and never reaches git worktree remove, so no test produces a real Git removal failure anymore. As a result, the listing that the earlier thread asked to keep for partial failures is now untested. A test that sends a locked worktree straight to remove_worktree would cover the boundary. Details are inline.
CI failed — codecov/patch: the Git removal-failure path is untested.
A branch-deletion failure can be lost after its checkout has already been removed. Return a contextual error through foreground and silent callers after arranging teardown, while preserving partial JSON results, including
retained_failed, and the underlying cancellation signal. Later failures in an already detached cleanup child continue to go to its log.The destructive Git command owns checkout-removal errors and surviving-entry details. Preflight and staging refusals keep their own diagnostic, so they do not imply that deletion partly succeeded; actual partial failures still list survivors.
Validation: 160 removal integration tests, 83 prune integration tests, and the cancellation and silent-picker unit regressions pass. The full project gate passes: 5,447 tests plus Clippy, formatting, docs, doctests, and lockfile checks. Independent source review found no remaining defects.