{"record":{"id":"703f53377dbf3593","repo":"abhigyanpatwari/GitNexus","slug":"must-not-contain-703f53","errorCode":null,"errorMessage":"must not contain \"@{\"","messagePattern":"must not contain \"@\\{\"","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/auto-sync/config.ts","lineNumber":345,"sourceCode":"  ) {\n    throw new Error(\n      'repository name must use only letters, digits, \".\", \"_\", or \"-\" and must not be \"unknown\"',\n    );\n  }\n}\n\nexport function validateAutoSyncBranchName(branch: string): void {\n  if (!branch.trim()) throw new Error('must not be empty');\n  if (/[\\s\\0-\\x1f\\x7f]/.test(branch))\n    throw new Error('must not contain whitespace or control characters');\n  if (/[~^:?*[\\\\]/.test(branch)) throw new Error('contains characters not allowed in a git ref');\n  if (branch.startsWith('-')) throw new Error('must not start with \"-\"');\n  if (branch.startsWith('/')) throw new Error('must not start with \"/\"');\n  if (branch.includes('..')) throw new Error('must not contain \"..\"');\n  if (branch.includes('`')) throw new Error('must not contain backticks');\n  if (branch.endsWith('/') || branch.endsWith('.')) throw new Error('must not end with \"/\" or \".\"');\n  if (branch.includes('//')) throw new Error('must not contain consecutive slashes');\n  if (branch.includes('@{')) throw new Error('must not contain \"@{\"');\n  if (\n    branch\n      .split('/')\n      .some(\n        (component) =>\n          component.startsWith('.') || component.endsWith('.') || component.endsWith('.lock'),\n      )\n  )\n    throw new Error('must not contain hidden, trailing-dot, or .lock path components');\n}\n\nexport function parseDurationMs(value: unknown): number {\n  if (typeof value === 'number') return value * 1_000;\n  const raw = String(value ?? '').trim();\n  const match = /^(\\d+)(ms|s|m)?$/.exec(raw);\n  if (!match) return Number.NaN;\n  const amount = Number(match[1]);\n  const unit = match[2] ?? 's';","sourceCodeStart":327,"sourceCodeEnd":363,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/0d1aed942f0e8b5d3bac27519fff441aceea722d/gitnexus/src/core/auto-sync/config.ts#L327-L363","documentation":"validateAutoSyncBranchName rejects branch names containing \"@{\", which git reserves as the reflog/at-expression syntax (e.g. HEAD@{1}); such names are ambiguous or invalid as refs. The auto-sync config parser enforces this so a config can never produce a branch name git would refuse or misinterpret.","triggerScenarios":"parseAutoSyncConfig receives a branch value containing the literal sequence \"@{\", e.g. \"branch@{yesterday}\" or \"rel@{date}\".","commonSituations":"Users pasting git reflog expressions into a branch-name config field, or templating syntax (@{...}) leaking through unresolved in the config file.","solutions":["Remove the \"@{\" sequence from the branch name.","If a reflog or template expression was intended, resolve it to a concrete branch name before writing the config.","Re-run parseAutoSyncConfig to confirm validation passes."],"exampleFix":"// before\nbranch: \"main@{yesterday}\"\n// after\nbranch: \"main\"","handlingStrategy":"validation","validationCode":"if (branch.includes('@{')) throw new Error('branch name must not contain \"@{\"');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not use reflog expressions like HEAD@{1} as branch names in config.","Resolve template placeholders before writing the config file.","Add a config-lint step that rejects \"@{\" in branch fields."],"tags":["config","git","validation","auto-sync"],"backgroundTag":"invalid-config-value","analyzedSha":"0d1aed942f0e8b5d3bac27519fff441aceea722d","analyzedAt":"2026-09-08T00:40:44.970Z","contentChangedAt":"2026-09-08T00:40:44.970Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}