{"record":{"id":"5d065f578c28c629","repo":"abhigyanpatwari/GitNexus","slug":"must-not-contain","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":341,"sourceCode":"    repoName === '..' ||\n    repoName === 'unknown' ||\n    repoName.startsWith('-') ||\n    !REMOTE_REPO_NAME_PATTERN.test(repoName)\n  ) {\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();","sourceCodeStart":323,"sourceCodeEnd":359,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/0d1aed942f0e8b5d3bac27519fff441aceea722d/gitnexus/src/core/auto-sync/config.ts#L323-L359","documentation":"Git forbids '..' in ref names because it denotes a range between two refs (a..b), so validateAutoSyncBranchName rejects any branch containing a '..' substring. The check runs at config parse time via parseAutoSyncBranchName's caller parseAutoSyncConfig, before git is invoked.","triggerScenarios":"branches: [\"main..dev\"] (a range expression, not a branch), [\"rel..2\"], or any name with two consecutive dots anywhere — including harmless-looking names like \"v1..0\" or \"foo..bar\".","commonSituations":"Developer pasted a git log range or diff expression as a branch; version strings with double dots from other ecosystems; typos like \"feature..fix\" when meaning \"feature.fix\".","solutions":["If you wanted a range, configure the individual branch(es) instead — ranges are not branch names.","Replace '..' with '.' or '-' in the name: v1..0 → v1.0 or v1-0.","Verify against `git branch --list` that the configured name matches a real branch.","Note a single dot is fine (release.1); only the two-dot sequence is rejected."],"exampleFix":"// before\nbranches:\n  - \"main..dev\"\n// after\nbranches:\n  - main\n  - dev","handlingStrategy":"validation","validationCode":"function noDotDot(b) {\n  return typeof b === 'string' && !b.includes('..');\n}\nconst bad = (cfg.branches ?? []).filter((b) => !noDotDot(b));\nif (bad.length) throw new Error(`branches must not contain \"..\": ${JSON.stringify(bad)}`);","typeGuard":null,"tryCatchPattern":"try {\n  validateAutoSyncBranchName(branch);\n} catch (e) {\n  if (String(e.message).includes('must not contain \"..\"')) {\n    log.error(`'${branch}' contains '..' (a git range); list individual branches instead.`);\n  }\n  throw e;\n}","preventionTips":["Never paste git range expressions (a..b) into branches[].","Use single dots or hyphens in version-like branch names.","Verify names against `git branch --list` output before configuring."],"tags":["config","git","branch","ref-syntax","validation"],"backgroundTag":"invalid-argument-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"}