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.
0 comments
muse hub commit comment sha256:33f281b8018012a4c63d0c3bdaf562983501678a34b64cc338ae054d5b84a703 --body "your comment"
No comments yet. Be the first to start the discussion.