Expand description
Input validation shared by CLI-facing entry points: git refs, root paths, and control-character rejection.
Functionsยง
- validate_
git_ ref - Validate a user-supplied git ref before it reaches a git subprocess:
rejects empty refs, option-like refs starting with
-, and characters outside the ref-syntax allowlist. - validate_
no_ control_ chars - Reject strings containing control characters (bytes < 0x20) except newline (0x0A) and tab (0x09). This prevents agents from accidentally passing invisible characters in CLI arguments.
- validate_
root - Canonicalize a project root and require it to be an existing directory.