fangorn/ex_git_objectstore
public
ref:624b9d54e5ee9bd2ad647e8bb1c431195046729b
fix: UploadPackV2 emits `ready` (or omits acks) when client sends `done`
`git fetch` against a repo served by `UploadPackV2` failed with
fatal: expected no other sections to be sent after no 'ready'
when the client's local history was unrelated to what's on the server.
The server emitted `acknowledgments\n NAK\n 0001 packfile\n ...`, which
violates the protocol v2 grammar — real git clients reject any
acknowledgments section that doesn't end with `ready` when a packfile
section follows.
Parse `done` from the fetch args and build the acks section accordingly:
- `done` + no matching haves -> omit the acks section
- `done` + some ACKs -> emit `ACK ... / ready / delim`
- no `done` (multi-round negotiation) -> emit `NAK / flush` or
`ACK ... / flush`
Adds two test layers:
- state-machine unit tests that lock in the protocol invariant
- a real-`git`-client interop test that spins up an in-process
`git://` TCP daemon and runs `git clone` / `git fetch` against
UploadPackV2 (catches framing bugs pure-Elixir tests miss)
Closes #27
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SHA:
624b9d54e5ee9bd2ad647e8bb1c431195046729b
Author:
Cole Christensen <cole.christensen@macmillan.com>
Date:
2026-04-18 22:21
Parents:
2b54c14
3 files changed
+441
-17
| Type | ||
|---|---|---|
|
|
lib/ex_git_objectstore/protocol/upload_pack_v2.ex | +36 −14 |
|
||