Skip to main content

validate_commit_path

Function validate_commit_path 

Source
pub fn validate_commit_path(value: &str) -> Result<(), GitArgError>
Expand description

Validates one entry of git.commit’s paths argument as a bounded, repository-relative filename. Git parses path arguments as pathspecs even after --, so build_add_argv and build_commit_argv prepend the fixed, internally-constructed :(literal) signature after validation. Caller text such as :(top), *, ?, brackets, leading dashes, control characters, and Unicode therefore remains filename text rather than Git syntax. NUL is rejected because operating-system argv cannot represent it.