fangorn/ex_git_objectstore
public
ref:b0352c4a236e6fdc329d4284d3113d469d582ccc
fix: UploadPackV2 always emits acks section when haves were sent
Follow-up to #27. The previous fix omitted the `acknowledgments`
section when the client sent haves that didn't match and also sent
`done`. Real git clients that sent any have enter `process_acks` and
reject this with
fatal: expected 'acknowledgments', received 'packfile'
Rule: if the `haves` list is non-empty, we MUST emit the
`acknowledgments` section. With `done`, it ends in `ready`; otherwise
`NAK` / `ACK` + flush (multi-round).
The prior integration test didn't catch this because the freshly-init'd
git client sent zero haves, so the broken branch never fired. This
commit forces haves via `--negotiation-tip=refs/heads/main`
+ `--depth=1` and adds an explicit `refute` on the regression error.
The state-machine test is also tightened to require the acks section
to be present (not just "if present, must end in ready").
Closes #28
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SHA:
b0352c4a236e6fdc329d4284d3113d469d582ccc
Author:
Cole Christensen <cole.christensen@macmillan.com>
Date:
2026-04-18 23:24
Parents:
624b9d5
3 files changed
+74
-37
| Type | ||
|---|---|---|
|
|
lib/ex_git_objectstore/protocol/upload_pack_v2.ex | +23 −21 |
|
||