Skip to main content

parse_pathspecs_from_source

Function parse_pathspecs_from_source 

Source
pub fn parse_pathspecs_from_source(
    data: &[u8],
    nul_terminated: bool,
) -> Result<Vec<String>, PathspecFromFileParseError>
Expand description

Read pathspec entries from raw file bytes (stdin or file), matching Git’s --pathspec-from-file / --pathspec-file-nul rules.

  • NUL mode: entries are separated by NUL; each segment is taken literally (no trimming or C-style unquoting).
  • Line mode: entries are separated by LF; optional CR before LF is stripped; optional trailing line without a final newline is included; double-quoted lines are C-unquoted (including octal escapes).