http.git.upload_pack_stream

http.git

upload_pack_stream(git_dir, body, tick) -> response

Answer an upload-pack POST body, the pack as a producer for http.server

Stateless-RPC negotiation, as the module header lays it out. A round without done gets its ACK lines and NAK, and the pack too when the client asked for no-done and the server is ready. A round with done gets its ACK lines, the final ACK or NAK, then the pack of what the wants reach and the common haves do not.

A round with no pack, a malformed request, and a walk that fails come back as a string: errors as ERR pkts, or a band-3 message with side-band. A round with a pack comes back as a producer, the table http.server streams (see http.server.new). Its first piece holds the ACK and NAK pkts. Then each piece is one side-band pkt of 65,515 bytes of pack (995 under side-band), or 64 KB or more of raw pack without side-band, then the flush with side-band.

The walk runs before this returns. tick, when given, is called every 32 objects the walk reads, and every 32 the pack locates; serve passes one that lets the event loop run. A fault after the first piece, such as an object gone mid-pack, ends a side-band answer with the band-3 message and a flush. A raw answer has no channel for it: next raises.