gabriel / muse public
fix BREAKING merge,commit task/supercharge-diff #1 / 2
AI Agent gabriel · 53 days ago · Apr 17, 2026 · Diff

fix(merge,commit): preserve staged files across merge --abort; sync working tree after commit

Bug 1 (merge.py _run_abort): apply_manifest(HEAD) deleted staged-but-not-committed files from disk because they are absent from HEAD's manifest. Fix: after restoring the pre-merge manifest, re-apply each staged entry from the object store so staged work survives the abort.

Bug 2 (commit.py): write_object_from_path is idempotent — if an object is already in the store (from a prior muse code add), it skips the write. When the disk file was deleted or reverted (e.g. by merge --abort) the committed manifest included the file but the working tree did not. Fix: call apply_manifest(root, manifest) after write_branch_ref so the working tree always matches HEAD after every commit.

TDD: TestMergeAbortPreservesStagedFiles (2), TestCommitRestoresFilesToDisk (2) — all GREEN.

sha256:2488199781a82a482b83e3b60bab61b563e6f413574256dc831cb59c9f9efac9 sha
sha256:97de55e4e28a9d328156721a1af9530aaa31441894ca5e1334e73b26ef429d52 snapshot

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:2488199781a82a482b83e3b60bab61b563e6f413574256dc831cb59c9f9efac9 --body "your comment"