Skip to main content

parse_raw_records

Function parse_raw_records 

Source
pub fn parse_raw_records(
    output: &[u8],
) -> Result<Vec<CandidateRecord>, CandidateError>
Expand description

What: Parse complete raw -z output into records, in Git’s order. &[u8] borrows the output; the records own copies of what they keep. Why: Each record is two NUL-terminated tokens. Output that does not end with a NUL, or that holds an odd number of tokens, was cut short or is not raw output, and is refused whole: a partial list would leave paths unchecked.

In TS you’d write (pseudocode):

function parseRawRecords(output: Buffer): CandidateRecord[];