MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / validateRef

Function validateRef

src/lib/git-client.ts:58–68  ·  view source on GitHub ↗
(ref: string)

Source from the content-addressed store, hash-verified

56 * Rejects refs that start with "-" or contain control characters.
57 */
58export 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
70let gitChecked = false;
71

Callers 5

resolveDefaultRefFunction · 0.85
resolveRefToShaFunction · 0.85
fetchSkillFilesFunction · 0.85
fetchSourceViaGitFunction · 0.85
git-client.test.tsFile · 0.85

Calls 1

findControlCharacterFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…