fangorn/ex_git_objectstore
public
ref:e378baf918185d16460d4a3f14170d5b7c9892f4
feat: wait-for-done + multi-round fetch negotiation
UploadPackV2's fetch handler unconditionally returned a packfile on
every request and forced the state machine to :done, which broke both:
* `git fetch --negotiate-only` — the client sends `wait-for-done`
(and `done`) expecting ONLY an `acknowledgments` section, no
packfile. Previously we'd still send a packfile; `--negotiate-only`
then errored out with "server does not support wait-for-done".
* Multi-round negotiation — git's default `consecutive` negotiator
may send `want`s + `have`s without `done` on the first request,
expecting the server to emit ACKs and wait. Previously the
session terminated after the first response.
Advertise the capability:
fetch=shallow wait-for-done
Response shape now depends on request flags:
done, no wait-for-done → acks + packfile, session ends
wait-for-done (± done) → acks only, session ends
neither → acks only, stay in :command for next
round
`process_command/2` threads the next phase back from `handle_fetch/2`
instead of hard-coding `:done`.
SHA:
e378baf918185d16460d4a3f14170d5b7c9892f4
Author:
Cole Christensen <cole.christensen@macmillan.com>
Date:
2026-04-19 00:24
Parents:
9b57103
3 files changed
+51
-13
| Type | ||
|---|---|---|
|
|
lib/ex_git_objectstore/protocol/upload_pack_v2.ex | +42 −8 |
|
||