Skip to main content

lines

Function lines 

Source
pub fn lines(commands: &[PushCommand], caps: &[String]) -> Result<Vec<Vec<u8>>>
Expand description

Render the command list as payload lines, without pkt-line framing, without the terminating flush-pkt and without the trailing newline: the caller owns the framer.

The capabilities ride on the first line only, after a NUL.

The newline is the framer’s, not this function’s, and every lines in this crate agrees on that. git frames these as text pkt-lines, which is <length><payload>\n; if the payload carried its own newline as well, one end of this crate would emit two and the other would chomp one, and the difference is invisible until a peer that does not chomp reads a reference name with a newline glued to it.