fix: push only delta objects — subtract have-snapshot objects in collect_object_ids and walk_commits
A snapshot is a full repo manifest, not a diff. Without subtracting the objects already reachable from have-commits' snapshots, every push sent all ~N objects even when only 1 file changed.
new_objects = objects_in_new_snapshots − objects_in_have_snapshots
Both collect_object_ids and walk_commits now collect have-commit snapshot objects and subtract them before returning. Gracefully skips have-commits whose snapshot is not stored locally (over-sends, does not crash).
Tests: 9 covering unchanged/new/removed/empty delta, walk_commits delta semantics, 10-file and 100-file repos, have=[] regression, missing snapshot.
sha256:9d2b992877f2b4ed7851f806069b17f1cecbe512fd99b507892b87d2925d1581
sha
+36
~2
symbols
sha256:a207ecbd06e2b8e89af591519983d8667f282a3a8ff1e98d067ece0bc24694bb
snapshot
+36
symbols added
~2
symbols modified
0
dead code introduced
Semantic Changes
38 symbols
+
test_new_object_included_when_not_in_have_snapshot
method
method test_new_object_included_when_not_in_have_snapshot L137–155
+
test_unchanged_object_excluded_when_in_have_snapshot
method
method test_unchanged_object_excluded_when_in_have_snapshot L118–135
+
test_missing_have_snapshot_treated_as_no_have
method
method test_missing_have_snapshot_treated_as_no_have L314–367
+
test_only_changed_file_sent_in_10_file_repo
method
method test_only_changed_file_sent_in_10_file_repo L225–251
+
test_walk_all_object_ids_excludes_have_objects
method
method test_walk_all_object_ids_excludes_have_objects L196–216
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:9d2b992877f2b4ed7851f806069b17f1cecbe512fd99b507892b87d2925d1581 --body "your comment"
No comments yet. Be the first to start the discussion.