abhigyanpatwari/GitNexus · error · GitNexusRcError
${source}: branch name must not contain "..".
Error message
${source}: branch name must not contain "..". What it means
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.
Source
Thrown at gitnexus/src/cli/analyze-config.ts:180
}
if (trimmed.length > BRANCH_MAX_LENGTH) {
throw new GitNexusRcError(`${source}: branch name is too long (max ${BRANCH_MAX_LENGTH}).`);
}
assertNoHiddenChars(trimmed, source);
if (/\s/.test(trimmed)) {
throw new GitNexusRcError(`${source}: branch name must not contain whitespace.`);
}
// git ref-name rules (subset): reject characters git itself forbids in refs.
if (/[~^:?*[\\]/.test(trimmed)) {
throw new GitNexusRcError(
`${source}: branch name contains characters not allowed in a git ref (~ ^ : ? * [ \\).`,
);
}
if (trimmed.startsWith('-')) {
throw new GitNexusRcError(`${source}: branch name must not start with "-".`);
}
if (trimmed.includes('..')) {
throw new GitNexusRcError(`${source}: branch name must not contain "..".`);
}
// Git permits a backtick in a ref, but the branch is embedded inside a
// Markdown inline-code span in the generated AGENTS.md/CLAUDE.md regression
// example, where a backtick would close the span early and let the rest of
// the template render as instruction text. Reject it at this single
// chokepoint so all three tiers (CLI flag, .gitnexusrc, auto-detect via
// sanitizeDetectedBranch) are covered (#1996 tri-review P1).
if (trimmed.includes('`')) {
throw new GitNexusRcError(
`${source}: branch name must not contain a backtick (it would break the generated Markdown).`,
);
}
return trimmed;
}
/**
* Best-effort validation for an auto-detected branch (from git). Never throws —
* returns `undefined` for anything unusable so the resolver falls back to theView on GitHub (pinned to d540b00184)
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.
Example fix
// before
{ "defaultBranch": "release/1..2" }
// after
{ "defaultBranch": "release/1.2" } Defensive patterns
Strategy: validation
Validate before calling
function assertNoDoubleDot(name: string): void {
if (name.includes('..')) {
throw new Error('branch name must not contain ".."');
}
} Type guard
function hasNoDoubleDot(name: string): boolean {
return typeof name === 'string' && !name.includes('..');
} Prevention
- 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 '..'.
When it happens
Trigger: Passing a branch name like 'feature..auth', 'release/1..2', or any name where two dots appear consecutively.
Common situations: 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 '..'.
Related errors
- ${source}: branch name must not be empty.
- ${source}: branch name is too long (max ${BRANCH_MAX_LENGTH}
- ${source}: branch name must not contain whitespace.
- ${source}: branch name contains characters not allowed in a
- ${source}: branch name must not start with "-".
AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12).
Data as JSON: /api/errors/dad862f881c8f69f.
Report an issue: GitHub.