Skip to main content

display_path

Function display_path 

Source
pub fn display_path(path: &[u8]) -> String
Expand description

What: Show a repository path as text. String::from_utf8_lossy replaces bytes that are not UTF-8 with U+FFFD; .into_owned() makes the result an owned String. Why: Messages and finding paths are text; Git paths are bytes.

In TS you’d write (pseudocode):

const shown = new TextDecoder().decode(path);