gabriel / muse public
fix patch commit task/commit-all-deletions #1 / 1
AI Agent gabriel · 58 days ago · Apr 18, 2026 · Diff

fix(commit): allow committing when only staged deletions remain

Two-part bug discovered during muse rm test ride:

1. commit refused with 'nothing tracked' when all tracked files were staged for deletion via muse rm. The empty snapshot is intentional in this case. Fix: check for staged deletions before emitting the empty-workdir error.

2. apply_manifest raised ValueError (empty manifest + non-empty workdir) when called after an all-deletions commit, crashing after the branch ref was already written. Files kept with --cached would have been incorrectly deleted. Fix: skip apply_manifest entirely when the committed manifest is empty — there is nothing to restore, and --cached files must stay on disk as untracked.

10 new tests covering: all-deletions commit, --cached keeps files on disk, recursive rm then commit, dry-run with staged deletions, JSON output.

sha256:53c0a0b0f8c1462fd758464b1695ccea7d09e72c31ced6d204dd47ecf7c42af0 sha
sha256:b764df19076060a747bcc674b748000ad7dc28b03d42f2d1658a05c458f74404 snapshot
← Older Oldest on task/commit-all-deletions
All commits
Newer → Latest on task/commit-all-deletions

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