ref:main
Implement fsck integrity verification #2
merged
cole.christensen@gmail.com wants to merge
feat/fsck-integrity-verification
into main
No CI
Summary
- Add
Fsck.check/2with:fulland:quickmodes for repository integrity verification - Add
list_objects/2callback to Storage behaviour, implemented in all three backends - Full mode verifies: loose object SHA integrity, object graph completeness, ref validity, pack checksums
- Quick mode verifies: ref validity and graph reachability only
Closes #14
Changes
- lib/ex_git_objectstore/fsck.ex — New module with
check/2entry point - lib/ex_git_objectstore/storage.ex — Added
list_objectscallback - lib/ex_git_objectstore/storage/{memory,filesystem,s3}.ex —
list_objectsimplementations - test/support/tracking_memory.ex — Added
list_objectsdelegation - test/ex_git_objectstore/fsck_test.exs — 11 tests covering all acceptance criteria
Test plan
- Valid repo returns clean report
- Detects corrupted object data (SHA mismatch)
- Detects missing object referenced by tree
- Detects missing parent commit
- Detects dangling ref
- Detects corrupted pack checksum
- Detects missing tag target
- Quick mode detects dangling ref but skips SHA verification
- Report includes counts
- All 540 tests pass, dialyzer clean
Created Apr 09, 2026 at 04:48 UTC
| Merged Apr 09, 2026 at 12:51 UTC
by
cole.christensen@gmail.com