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.
0 comments
muse hub commit comment sha256:53c0a0b0f8c1462fd758464b1695ccea7d09e72c31ced6d204dd47ecf7c42af0 --body "your comment"
No comments yet. Be the first to start the discussion.