gabriel / muse public
fix patch task/fix-checkout-dirty-bleedthrough #1 / 1
AI Agent gabriel · 50 days ago · Apr 22, 2026 · Diff

fix: checkout now refuses on any dirty tracked file

The old require_clean_workdir only blocked files that the target branch would overwrite (different object_id between HEAD and target). Files that were modified locally but identical on both branches silently bled through — exactly the bug that left 80+ modified files on branches the user never touched.

Fix: remove the permissive target_manifest narrowing path from require_clean_workdir. Any dirty tracked file now blocks checkout; users must commit, shelf, --autoshelf, or --force explicitly.

Fix --force on branch switch: pass current_snapshot_id=None so _checkout_snapshot diffs empty→target, restoring ALL target files and discarding local modifications (consistent with what --force implies).

Tests: TestDirtyWorkdirBleedThrough (9 tests) — red before, green after. Delete TestSwitchWithNonConflictingChanges tests that asserted the bug.

sha256:3d2ec5a1f34b82c1c61ce7ed91de1c2b8ae50a3239a683248e10e7e8f5f00737 sha
sha256:a54b2214b6595f85364ecc903c7e8da403b95de694ca158a79d15ed8d1700120 snapshot
← Older Oldest on task/fix-checkout-dirty-bleedthrough
All commits
Newer → Latest on task/fix-checkout-dirty-bleedthrough

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:3d2ec5a1f34b82c1c61ce7ed91de1c2b8ae50a3239a683248e10e7e8f5f00737 --body "your comment"