gabriel / muse public
fix minor dead fix/dead-working-tree-deleted-files #1 / 1
gabriel · 165 days ago · Apr 8, 2026 · Diff

fix(dead): exclude working-tree-deleted files from dead scan

When from_disk=True and a file was deleted from the working tree without being committed, _load_file_bytes was falling back to the object store and including the deleted file's bytes in the scan. This caused symbols in deleted files to be incorrectly reported as dead code.

Fix: drop the object-store fallback in from_disk mode. A deleted file has no symbols — none of its symbols can be dead. Simply skip it.

Adds regression test: TestDeadIntegration::test_deleted_working_tree_file_excluded_from_dead_scan

Fixes: muse code dead showing stale symbols for uncommitted file deletions.

sha256:3a6c80e2cfb40cc9afead067963d6bbb0a856593a3df61edf48ae91850c11ef2 sha
+1 ~2 symbols
sha256:7b2e98c7b9bbf1915cbd3df5cb9135cf4397bf385e5b88e982d9a3290adf90ae snapshot
+1
symbol added
~2
symbols modified
0
dead code introduced
Semantic Changes 3 symbols
~ muse/cli/commands/dead.py .py 1 symbol modified
~ tests/test_cmd_dead.py .py 1 symbol added, 1 symbol modified
+ test_deleted_working_tree_file_excluded_from_dead_scan method method test_deleted_working_tree_file_excluded_from_dead_scan L539–576
← Older Oldest on fix/dead-working-tree-deleted-files
All commits
Newer → Latest on fix/dead-working-tree-deleted-files

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:3a6c80e2cfb40cc9afead067963d6bbb0a856593a3df61edf48ae91850c11ef2 --body "your comment"