Parent
[>]
1//! Smart HTTP git protocol handlers. 2//! 3//! Provides handlers for `info/refs` (ref advertisement) and `git-upload-pack` 4//! (pack negotiation and transport), enabling `git clone` and `git fetch` over 5//! HTTP without CGI. 6//! 7//! Both handlers shell out to `git upload-pack --stateless-rpc`, following the 8//! same streaming pattern as the archive handler. 9 10use Stdio; 11 12use Body; 13use ; 14use HeaderMap; 15use header; 16use IntoResponse; 17use Deserialize; 18use Command; 19use ReaderStream; 20 21use crate; 22use crategit; 23use crate; 24 25use reaper; 26 27/// Query parameters for `info/refs`. 28 29pub 32 33/// Encodes a string as a pkt-line (4-digit hex length + payload). 34 38 39/// Handles `GET /{repo}/info/refs?service=git-upload-pack`. 40/// 41/// Returns a ref advertisement so clients can discover branches and tags before 42/// fetching. The response is a pkt-line stream with a `# service=git-upload-pack` 43/// header, followed by the output of `git upload-pack --stateless-rpc --advertise-refs`. 44pub async 92 93/// Handles `POST /{repo}/git-upload-pack`. 94/// 95/// Processes a pack-request body (wants / haves) and streams back the generated 96/// pack file. The response is a pkt-line stream with status/progress messages 97/// in band 2 and pack data in band 1. 98pub async