gabriel / muse public
feat patch checkout task/checkout-autostash #1 / 1
gabriel · 63 days ago · Apr 13, 2026 · Diff

feat(checkout): --autostash flag with full test coverage

- Add --autostash to muse checkout: stash → switch → pop via try/finally, so the stash is always popped regardless of success or SystemExit - Stash message mirrors git idiom: 'WIP on <branch>: autostash' - --autostash + --dry-run: no stash created, assume clean for preview - --autostash + -b: no-op (no snapshot switch, changes preserved) - --autostash is mutually exclusive with --force and --merge - Add _stash_push_programmatic / _stash_pop_programmatic to stash.py as a clean programmatic API (no argparse, no prints, raises exceptions) - _stash_pop_programmatic wraps OSError from object-store integrity checks into RuntimeError for consistent caller contracts - _apply_autostash: text mode prints to stdout, JSON mode to stderr (keeps stdout machine-readable in --json mode) - Improve guard.py error to list all four remedies: stash / --merge / --force / --autostash with one-line descriptions - 33 tests: unit (programmatic API, _apply_autostash output/streams/ corrupt-object), integration (clean/dirty tree, JSON mode, new files, mutually exclusive flags, --dry-run, -b, round-trips)

sha256:ccc437307c53f10bd6f01134e361b8576bcc669bad0bcbfbdd7d6e31d59d3519 sha
sha256:20bdc5bb333af3c1b1675c488941cd93d6fa1169d7007e5723e89e650a6b46f1 snapshot
← Older Oldest on task/checkout-autostash
All commits
Newer → Latest on task/checkout-autostash

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