Skip to main content

unquote_c_style_path

Function unquote_c_style_path 

Source
pub fn unquote_c_style_path(s: &str) -> Vec<u8> 
Expand description

Decode a git C-quoted path into its raw bytes.

git wraps a path in double quotes and C-escapes it when it contains a control byte, a ", a \\, or — with the default core.quotePath=true — a non-ASCII byte (for example, é becomes \\303\\251). A path without a leading " is returned unchanged, so callers may apply this unconditionally. Octal escapes decode to raw bytes, allowing the result to be passed losslessly to path_from_bytes. Decoding stops at the first unescaped closing quote; trailing bytes are ignored.