(branch: string)
| 103 | } |
| 104 | |
| 105 | export function validateBranch(branch: string): void { |
| 106 | if (/^[A-Za-z0-9/_.-]+$/.test(branch) && !branch.startsWith("-") && !branch.includes("..")) return |
| 107 | throw new InvalidBranchError({ |
| 108 | branch, |
| 109 | message: "Branch must contain only alphanumeric characters, /, _, ., and -, and cannot start with - or contain ..", |
| 110 | }) |
| 111 | } |
| 112 | |
| 113 | export function isFile(reference: Reference): reference is FileReference { |
| 114 | return reference.protocol === "file:" |