fix(commit): stop overwriting working tree after commit
muse commit was calling apply_manifest() after writing the snapshot, restoring every tracked file from the object store and silently destroying any unstaged changes on disk. commit should only write to the object store and advance the branch ref — identical to Git.
Removed apply_manifest call and unused import from commit.py. Replaced TestCommitRestoresFilesToDisk (which asserted the wrong behaviour) with a comment. Added test_commit_workdir_preservation.py with 6-test regression suite covering the data loss path.
sha256:d8ae5a872e6b33e63c3c9d188169fe8f834b2411fcf7d5ca1a0a58faada14082
sha
+13
~1
−4
symbols
sha256:75577aa270f58d62c91d7a7a0e1fd01f906bd0d16a7a1a8de1e3985cf7e6f8cc
snapshot
+13
symbols added
~1
symbol modified
−4
symbols removed
0
dead code introduced
Semantic Changes
18 symbols
+
test_new_untracked_file_not_deleted_by_commit
method
method test_new_untracked_file_not_deleted_by_commit L96–115
+
test_staged_deletion_still_removes_file
method
method test_staged_deletion_still_removes_file L117–127
+
test_unstaged_changes_to_multiple_files
method
method test_unstaged_changes_to_multiple_files L55–78
+
test_working_tree_unchanged_after_first_commit
method
method test_working_tree_unchanged_after_first_commit L129–136
~
run
−
test_added_file_exists_on_disk_after_commit
method
method test_added_file_exists_on_disk_after_commit L965–986
−
test_modified_file_reflects_committed_content_after_commit
method
method test_modified_file_reflects_committed_content_after_commit L988–1007
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:d8ae5a872e6b33e63c3c9d188169fe8f834b2411fcf7d5ca1a0a58faada14082 --body "your comment"
No comments yet. Be the first to start the discussion.