(ref: string)
| 56 | * Rejects refs that start with "-" or contain control characters. |
| 57 | */ |
| 58 | export function validateRef(ref: string): void { |
| 59 | if (ref.startsWith("-")) { |
| 60 | throw new GitClientError(`Ref must not start with "-": "${ref}"`); |
| 61 | } |
| 62 | const ctrl = findControlCharacter(ref); |
| 63 | if (ctrl) { |
| 64 | throw new GitClientError( |
| 65 | `Ref contains control character ${ctrl.hex} at position ${ctrl.position}`, |
| 66 | ); |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | let gitChecked = false; |
| 71 |
no test coverage detected
searching dependent graphs…