gabriel / muse public
fix main #25 / 100

fix: muse code add skipped unchanged-vs-HEAD check, staging all files

When the stage index was empty (first run of muse code add), the only skip guard compared the newly-computed hash against the existing stage entry. That check was vacuously false for every file, so every file in the working tree was staged — even ones whose content was byte-for-byte identical to the last committed snapshot.

Fix: after hashing a file, compare its object_id against head_manifest. If they match the file has not changed; skip without staging it. This makes muse code add . agree with muse status: only genuinely-changed files appear in the stage.

Regression test: test_add_dot_does_not_stage_unchanged_files verifies that only the modified file is staged when two files exist and only one is edited between commits.

G Gabriel Cardona <gabriel@tellurstori.com> · 1d ago Mar 22, 2026 · 5b27712b · parent 95e97820
2
files changed
410
files in snapshot
Files Changed 410 in snapshot
~2

0 comments

No comments yet. Be the first to start the discussion.