gabriel / muse public
fix minor task/fix-checkout-create-dirty-tree #1 / 1
gabriel · 152 days ago · Apr 8, 2026 · Diff

fix: checkout -b with dirty workdir no longer blocked

checkout -b creates a new branch at the current HEAD — no file content changes, so dirty tracked files cannot be overwritten. The dirty-workdir guard was firing unconditionally before the create vs. switch decision, forcing an unnecessary stash/unstash cycle every time a feature branch was started with uncommitted WIP.

Fix: skip require_clean_workdir when create=True. The guard still fires for switching to an existing branch whose snapshot differs from workdir.

Regression test: test_create_with_dirty_workdir_succeeds verifies exit 0, correct branch switch, and dirty file preservation.

sha256:0fdc2b726ba8033af722e14da92867409f2d98d28db86ece8b14d4154219c03a sha
+1 ~2 symbols
sha256:633b4d4a35f278b57e32f03db8b46953c8c585ada289ca30c1213768df866c0b snapshot
+1
symbol added
~2
symbols modified
0
dead code introduced
Semantic Changes 3 symbols
~ muse/cli/commands/checkout.py .py 1 symbol modified
~ run
~ tests/test_cmd_checkout.py .py 1 symbol added, 1 symbol modified
+ test_create_with_dirty_workdir_succeeds method method test_create_with_dirty_workdir_succeeds L358–371
← Older Oldest on task/fix-checkout-create-dirty-tree
All commits
Newer → Latest on task/fix-checkout-create-dirty-tree

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:0fdc2b726ba8033af722e14da92867409f2d98d28db86ece8b14d4154219c03a --body "your comment"