fangorn/ex_git_objectstore
public
ref:4c5251ddc23bbdcf15471d8fd260ad076ef8b11f
Implement fsck integrity verification (#2)
## Summary
- Add `Fsck.check/2` with `:full` and `:quick` modes for repository integrity verification
- Add `list_objects/2` callback 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/2` entry point
- **lib/ex_git_objectstore/storage.ex** — Added `list_objects` callback
- **lib/ex_git_objectstore/storage/{memory,filesystem,s3}.ex** — `list_objects` implementations
- **test/support/tracking_memory.ex** — Added `list_objects` delegation
- **test/ex_git_objectstore/fsck_test.exs** — 11 tests covering all acceptance criteria
## Test plan
- [x] Valid repo returns clean report
- [x] Detects corrupted object data (SHA mismatch)
- [x] Detects missing object referenced by tree
- [x] Detects missing parent commit
- [x] Detects dangling ref
- [x] Detects corrupted pack checksum
- [x] Detects missing tag target
- [x] Quick mode detects dangling ref but skips SHA verification
- [x] Report includes counts
- [x] All 540 tests pass, dialyzer clean
SHA:
4c5251ddc23bbdcf15471d8fd260ad076ef8b11f
Author:
Anvil <noreply@anvil.fangorn.io>
Date:
2026-04-09 12:51
Parents:
552f599
7 files changed
+724
-0
| Type | ||
|---|---|---|
|
|
test/support/tracking_memory.ex | +6 −0 |
|
||