Skip to main content

parse_ref_advertisement

Function parse_ref_advertisement 

Source
pub fn parse_ref_advertisement(buf: &[u8]) -> Result<Vec<(String, String)>>
Expand description

Parse a git smart-protocol ref advertisement (the bytes a server emits right after git-upload-pack) into (sha, refname) pairs.

pkt-line framing: each line is 4 hex digits of length (counting the 4) then the payload; 0000 is a flush. The first ref line carries capabilities after a NUL. A leading # service=… line (smart-HTTP style) is skipped.