{"record":{"id":"dad862f881c8f69f","repo":"abhigyanpatwari/GitNexus","slug":"source-branch-name-must-not-contain","errorCode":null,"errorMessage":"${source}: branch name must not contain \"..\".","messagePattern":"(.+?): branch name must not contain \"\\.\\.\"\\.","errorType":"validation","errorClass":"GitNexusRcError","httpStatus":null,"severity":"error","filePath":"gitnexus/src/cli/analyze-config.ts","lineNumber":180,"sourceCode":"  }\n  if (trimmed.length > BRANCH_MAX_LENGTH) {\n    throw new GitNexusRcError(`${source}: branch name is too long (max ${BRANCH_MAX_LENGTH}).`);\n  }\n  assertNoHiddenChars(trimmed, source);\n  if (/\\s/.test(trimmed)) {\n    throw new GitNexusRcError(`${source}: branch name must not contain whitespace.`);\n  }\n  // git ref-name rules (subset): reject characters git itself forbids in refs.\n  if (/[~^:?*[\\\\]/.test(trimmed)) {\n    throw new GitNexusRcError(\n      `${source}: branch name contains characters not allowed in a git ref (~ ^ : ? * [ \\\\).`,\n    );\n  }\n  if (trimmed.startsWith('-')) {\n    throw new GitNexusRcError(`${source}: branch name must not start with \"-\".`);\n  }\n  if (trimmed.includes('..')) {\n    throw new GitNexusRcError(`${source}: branch name must not contain \"..\".`);\n  }\n  // Git permits a backtick in a ref, but the branch is embedded inside a\n  // Markdown inline-code span in the generated AGENTS.md/CLAUDE.md regression\n  // example, where a backtick would close the span early and let the rest of\n  // the template render as instruction text. Reject it at this single\n  // chokepoint so all three tiers (CLI flag, .gitnexusrc, auto-detect via\n  // sanitizeDetectedBranch) are covered (#1996 tri-review P1).\n  if (trimmed.includes('`')) {\n    throw new GitNexusRcError(\n      `${source}: branch name must not contain a backtick (it would break the generated Markdown).`,\n    );\n  }\n  return trimmed;\n}\n\n/**\n * Best-effort validation for an auto-detected branch (from git). Never throws —\n * returns `undefined` for anything unusable so the resolver falls back to the","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/gitnexus/src/cli/analyze-config.ts#L162-L198","documentation":"Thrown by validateBranchName() when the branch name contains '..'. Git interprets '..' and '...' as revision-range operators (X..Y means commits in Y not in X), so a name with '..' is ambiguous and rejected by git refname rules.","triggerScenarios":"Passing a branch name like 'feature..auth', 'release/1..2', or any name where two dots appear consecutively.","commonSituations":"A version-style name with an ellipsis ('release/1..2'); an accidental double-period from fast typing; a name derived from a path that contained '..'.","solutions":["Replace '..' with a single '.' or a '-' (e.g. 'release/1.2' or 'release/1-2').","Re-type the name carefully to avoid consecutive dots."],"exampleFix":"// before\n{ \"defaultBranch\": \"release/1..2\" }\n\n// after\n{ \"defaultBranch\": \"release/1.2\" }","handlingStrategy":"validation","validationCode":"function assertNoDoubleDot(name: string): void {\n  if (name.includes('..')) {\n    throw new Error('branch name must not contain \"..\"');\n  }\n}","typeGuard":"function hasNoDoubleDot(name: string): boolean {\n  return typeof name === 'string' && !name.includes('..');\n}","tryCatchPattern":null,"preventionTips":["Use a single '.' in version-like branch names (release/1.2 not release/1..2).","Re-read fast-typed names to catch accidental double periods.","Avoid deriving branch names from filesystem paths that contain '..'."],"tags":["validation","git","branch","config"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}