Skip to main content

strip_git_line

Function strip_git_line 

Source
pub fn strip_git_line(output: &[u8]) -> &[u8] ⓘ
Expand description

What: Remove exactly one final line break (\n or \r\n) from Git output. &[u8] borrows bytes; the result borrows a shorter view of the same bytes. Why: Git terminates each printed value with one line break; anything before it, including other line breaks, is part of the value.

In TS you’d write (pseudocode):

function stripGitLine(output: Buffer): Buffer;