fangorn/ex_git_objectstore
public
ref:b77b43f6e20a9d8af0a8de68008f754f214ae75a
test: fill coverage gaps (filter, shallow, atomic) + fix deepen walker
Five coverage gaps flagged by grading are now closed, and the
shallow walker got a correctness fix surfaced by the new tests.
Added:
- test/ex_git_objectstore/pack/filter_test.exs — 30 unit tests for
Filter.parse/1 (every spec form + rejections) and include?/3
(every ctx shape per spec).
- capabilities_test.exs gains:
* --filter=object:type=commit yields a commits-only pack
* --filter=combine:blob:none+tree:1 composes sub-filters
* --filter=sparse:oid=<oid> matches blob paths against a
sparse-checkout spec blob
- receive_pack_git_client_test.exs gains:
* atomic rejects the batch when one command has a stale old_sha
(validation-phase rollback)
* mid-commit storage failure rolls back every applied ref
(uses new FailingStorage test backend)
- test/support/failing_storage.ex — a Storage behaviour wrapper
around Memory that can be armed with `fail_put_ref_once/2` to
inject a one-shot put_ref failure. Used by the new atomic
mid-commit-failure test.
- capabilities_test.exs gains two deepen sub-protocol tests:
* --shallow-since=<date> (deepen-since)
* --shallow-exclude=<ref> (deepen-not)
Fixed while writing those tests:
Shallow walker was including commits that failed `deepen-since` or
were in the `deepen-not` exclusion set — because the since/exclude
check happened AFTER the commit was already recorded. Moved the
check to parent-enqueue time: when examining a commit's parents,
any parent that's excluded or pre-cutoff is pruned; if no
walkable parent survives, the current commit correctly becomes a
new shallow boundary.
793 tests, 0 failures.
SHA:
b77b43f6e20a9d8af0a8de68008f754f214ae75a
Author:
Cole Christensen <cole.christensen@macmillan.com>
Date:
2026-04-19 01:17
Parents:
45d9667
5 files changed
+742
-12
| Type | ||
|---|---|---|
|
|
test/support/failing_storage.ex | +137 −0 |
|
||