Skip to main content

os_from_path_bytes

Function os_from_path_bytes 

Source
pub fn os_from_path_bytes(bytes: &[u8]) -> OsString
Expand description

What: Raw path bytes as an operating-system string for a command line or a file name. &[u8] borrows the bytes; the result owns a copy. Why: A Git path is bytes, and only the platform decides how to pass them on: Unix takes them as they are, other platforms have text names, so the text with replacement characters is the closest name.

In TS you’d write (pseudocode):

Buffer.from(bytes)