Skip to content

fix(sync): show dirty status instead of pruned for unremovable worktrees#298

Merged
avihut merged 1 commit intomasterfrom
fix/dirty-worktree-indicated-pruned-after-sync
Mar 13, 2026
Merged

fix(sync): show dirty status instead of pruned for unremovable worktrees#298
avihut merged 1 commit intomasterfrom
fix/dirty-worktree-indicated-pruned-after-sync

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Mar 13, 2026

Summary

  • When a worktree has uncommitted changes and its remote branch is deleted, the TUI prune phase now shows "⊘ dirty" (yellow) instead of misleadingly showing "✓ up to date" or potentially "— pruned" with strikethrough
  • Adds RemoveOutcome enum to distinguish dirty-skipped from other removal failures, propagated through the prune call chain via new skipped_dirty field
  • Fixes dangerous catch-all _ => FinalStatus::Pruned in the prune status mapping (changed to UpToDate)

Test plan

  • mise run fmt:check passes
  • mise run clippy passes with zero warnings
  • mise run test:unit passes (638 tests, including new prune_skipped_dirty_sets_dirty_status test)
  • Manual test: create a worktree, make it dirty, delete its remote branch, run daft sync — verify "⊘ dirty" appears instead of "— pruned" or "✓ up to date"

🤖 Generated with Claude Code

When a worktree has uncommitted changes and its remote branch is deleted,
the prune phase now shows "⊘ dirty" (yellow) instead of incorrectly
displaying "— pruned" with strikethrough or misleadingly showing
"✓ up to date".

Changes:
- Add RemoveOutcome enum to distinguish dirty skip from other failures
- Propagate skipped_dirty through the prune call chain
- Add TaskMessage::SkippedDirty and FinalStatus::Dirty variants
- Fix dangerous catch-all `_ => FinalStatus::Pruned` in prune status
  mapping (now defaults to UpToDate)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avihut avihut added this to the v1.1.0 milestone Mar 13, 2026
@avihut avihut added the fix Bug fix label Mar 13, 2026
@avihut avihut self-assigned this Mar 13, 2026
@avihut avihut merged commit 19d1298 into master Mar 13, 2026
6 checks passed
@avihut avihut deleted the fix/dirty-worktree-indicated-pruned-after-sync branch March 13, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant