fix(stage,status): don't re-stage or surface already-committed empty dirs
Two bugs, both about empty dirs that are already in HEAD's snapshot.directories:
1. muse code add . was sentinel-staging committed empty dirs on every run because the empty_dirs_to_stage loop had no check against HEAD dirs. Fix: skip any dir already in _head_snapshot_dirs() before staging.
2. muse status was showing committed empty dirs as staged.added when their sentinel was in the stage index, because staged_added_dirs wasn't filtered against committed_empty_dirs when building DirStatus. Fix: staged_added=sorted(staged_added_dirs - committed_empty_dirs).
Regression tests: TestStageIdempotency (4 tests) in test_code_stage.py, D9/D10 in test_status_directory_tracking.py.
sha256:00518230287e4eef5012e619cd030beb8883260e0b170ee53d68d89bbe058928
sha
+10
~5
symbols
sha256:b5ba3cc0123fffd9e94c60392fb969e29a4fc00c3566386a69c21902dce45040
snapshot
+10
symbols added
~5
symbols modified
0
dead code introduced
Semantic Changes
15 symbols
~
run_add
+
test_committed_empty_dir_not_staged_on_add
method
method test_committed_empty_dir_not_staged_on_add L1011–1025
+
test_second_add_after_deletion_staged_is_noop
method
method test_second_add_after_deletion_staged_is_noop L985–996
+
test_second_add_after_modification_staged_is_noop
method
method test_second_add_after_modification_staged_is_noop L998–1009
+
test_total_matches_sum_of_categories
method
method test_total_matches_sum_of_categories L1027–1050
~
_env
+
test_D10_committed_dir_clean_after_commit
method
method test_D10_committed_dir_clean_after_commit L226–235
+
test_D9_committed_dir_not_in_staged_added_after_code_add
method
method test_D9_committed_dir_not_in_staged_added_after_code_add L209–224
Older
fix(stage): make code add idempotent for deletions and dir sentinels
sha256:9b4ea477b4ddf7b5285f01c12622078dc5cdb14fbdf35ab046d8d170556d285f
All commits
Newer
fix(status): filter dir sentinels from text output staged section
sha256:56bdd695c63e169455691b0d6bf489864a3692dd69293cde3b831aac15b61049
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:00518230287e4eef5012e619cd030beb8883260e0b170ee53d68d89bbe058928 --body "your comment"
No comments yet. Be the first to start the discussion.