Skip to main content

parse_upload_pack_shallow_info_section

Function parse_upload_pack_shallow_info_section 

Source
pub fn parse_upload_pack_shallow_info_section(
    format: ObjectFormat,
    input: &[u8],
) -> Result<(Vec<ProtocolV2FetchShallowInfo>, usize)>
Expand description

Parse the smart-HTTP/SSH v0 shallow-info section that precedes the packfile when the upload-pack request carried shallow/deepen/deepen-since/ deepen-not arguments.

The section is zero or more shallow <oid> / unshallow <oid> pkt-lines terminated by a flush-pkt; git always emits it (even empty, as a bare flush) when the request was a deepen request, and never emits it otherwise. Returns the parsed entries and the number of bytes consumed (through the flush) so the caller can continue parsing the trailing acknowledgments + packfile from &input[consumed..] (see parse_upload_pack_shallow_info_and_raw_packfile_response).