fix: autoshelf must not restore committed source-branch files on target
When `muse checkout <target> --autoshelf` was run from a task branch that had committed-but-not-yet-merged changes, those committed files bled into the target working tree as phantom modifications — causing `muse merge` to refuse with 'your local changes would be overwritten'.
Root cause: `_apply_shelf_snapshot` iterated the full working-tree snapshot without distinguishing files that were actually dirty (uncommitted edits) from files that happened to differ from the target branch because they were committed on the source branch.
Fix: load the source branch HEAD manifest from `entry['parent_commit']` and skip any file whose shelf hash matches the source HEAD hash — those were clean when shelved and belong to the merge, not the shelf.
Regression tests added to TestAutoshelfDirtyIsolation: - test_committed_source_file_not_in_working_tree_after_autoshelf - test_dirty_file_is_restored_after_autoshelf - test_working_tree_clean_except_dirty_file_after_autoshelf
0 comments
muse hub commit comment sha256:441516031c662910037b4a251788f71cf0b20529f43307b4a672243de50f5eb5 --body "your comment"
No comments yet. Be the first to start the discussion.