gabriel / muse public
fix minor feat/fix-ignored-extant-deleted #1 / 1
gabriel · 70 days ago · Apr 7, 2026 · Diff

fix: ignored-and-extant files no longer reported as deleted in status/stash

Previously, a file that was committed in HEAD, added to .museignore, and still present on disk was treated as 'deleted' by diff_workdir_vs_snapshot. This had three cascading effects:

1. muse status showed these files as deleted, making the tree look dirty. 2. muse checkout was blocked by require_clean_workdir — checkout was impossible without first committing or stashing (a catch-22 since stash had the same problem). 3. muse stash recorded them as deleted, so stash pop would call unlink() on them — silently destroying build artifacts still needed on disk.

Fix: - Promote _load_ignore_patterns → load_ignore_patterns (public) so other modules can apply the same ignore rules without duplicating logic. - diff_workdir_vs_snapshot: after computing deleted, filter out paths that are in .museignore and still physically present on disk. A file is only 'deleted' if it is genuinely absent from the working tree. - stash.run: apply the same filter to its own deleted computation so stash entries never record ignored-and-extant files as deleted.

The edge case is preserved: a file in .museignore that is genuinely absent from disk (truly deleted) still appears in deleted as expected.

sha256:33f281b8018012a4c63d0c3bdaf562983501678a34b64cc338ae054d5b84a703 sha
sha256:7e6dccfa37c551e512bbe28826392730ac2209481851986ae797fbb69ade20e4 snapshot
← Older Oldest on feat/fix-ignored-extant-deleted
All commits
Newer → Latest on feat/fix-ignored-extant-deleted

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:33f281b8018012a4c63d0c3bdaf562983501678a34b64cc338ae054d5b84a703 --body "your comment"