gabriel / muse public
fix BREAKING guard dev
gabriel · 60 days ago · Apr 16, 2026 · Diff

fix(guard): emit JSON error to stdout when --json and dirty workdir blocks operation

require_clean_workdir only wrote to stderr and raised SystemExit. Agents using --json 2>/dev/null got exit 1 with nothing on stdout — no way to tell what failed or what to do next.

Add fmt parameter (default 'text') to require_clean_workdir. In JSON mode, emit a structured object to stdout before exiting: {error, operation, message, files, hint}

Thread fmt through all five callers: merge, reset, revert, checkout, cherry-pick.

sha256:39b99f972a765b1512446a60f83652068912b343ae54f3647d778514fa6610c5 sha
sha256:a2a870dff0b4bd2792984e34b66c8ffae8aff4c3e249bfe1ed80f78f4e47201b snapshot
← Older Oldest on dev
All commits
Newer → Latest on dev

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