Reject values that could be parsed as a git flag when used as a positional.
(value: string, name: string)
| 27 | |
| 28 | /** Reject values that could be parsed as a git flag when used as a positional. */ |
| 29 | function assertNoLeadingDash(value: string, name: string): void { |
| 30 | if (value.startsWith('-')) { |
| 31 | throw new Error( |
| 32 | `git-exec: ${name} "${value}" must not begin with "-" (argument-injection guard).`, |
| 33 | ) |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | // Credential helper that prints creds read from the child ENV. Single-quoted at |
| 38 | // the call site so the outer shell passes it literally; git expands the vars in |
no outgoing calls
no test coverage detected