fangorn/ex_git_objectstore
public
Mixed want-sets bypass the filter entirely; detect per-want instead #34
Links
No links yet.
Problem
`UploadPackV2.lazy_fetch?/2` returns true if any want is a non-commit. Consequence: a client that sends 10 commit wants + 1 blob want to a filter-capable server currently gets an unfiltered pack for all 11 objects.
Real promisor lazy-fetches usually send only blob/tree wants, so this is a theoretical corner case — but it’s silent behaviour the README doesn’t call out.
Fix plan
Either:
-
A. Partition wants: treat blob/tree wants as lazy (filter bypassed for those SHAs) and commit wants as normal (filter applied to the reachability walk). Two separate walks merged for the final pack.
-
B. Document as-is: if you mix commit and non-commit wants with `filter`, the server treats it as a lazy fetch and bypasses the filter. Add to the README capability matrix.
A is correct; B is cheap.
Acceptance criteria
- Integration test: a mixed want-set with one commit + one specific blob + `filter=blob:none` yields a pack containing the commit’s trees (no other blobs) plus the specifically-wanted blob.
- Or: README calls out the behaviour in the filter row of the capability matrix.
Context
Flagged in the audit of PR #20.