gabriel / muse public
fix BREAKING commit dev
AI Agent gabriel · 146 days ago · Apr 26, 2026 · Diff

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
+ TestCommitPreservesWorkdir class class TestCommitPreservesWorkdir L33–136
+ 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_survive_commit method method test_unstaged_changes_survive_commit L34–53
+ test_unstaged_changes_to_multiple_files method method test_unstaged_changes_to_multiple_files L55–78
+ test_untracked_files_survive_commit method method test_untracked_files_survive_commit L80–94
+ test_working_tree_unchanged_after_first_commit method method test_working_tree_unchanged_after_first_commit L129–136
+ _run function function _run L23–25
+ CliRunner import import CliRunner L18–18
+ annotations import import annotations L12–12
+ pathlib import import pathlib L14–14
+ pytest import import pytest L16–16
+ runner variable variable runner L20–20
~ muse/cli/commands/commit.py .py 1 symbol removed, 1 symbol modified
apply_manifest import import apply_manifest L45–45
~ run
~ tests/test_cmd_commit.py .py 3 symbols removed
TestCommitRestoresFilesToDisk class class TestCommitRestoresFilesToDisk L963–1007
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
← 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:d8ae5a872e6b33e63c3c9d188169fe8f834b2411fcf7d5ca1a0a58faada14082 --body "your comment"