abhigyanpatwari/GitNexus · error · Error
must not contain hidden, trailing-dot, or .lock path compone
Error message
must not contain hidden, trailing-dot, or .lock path components
What it means
validateAutoSyncBranchName rejects branch names with any slash-separated component that starts with "." (hidden), ends with "." (trailing dot), or ends with ".lock", matching git's ref rules that forbid hidden components and lock-file collisions. The auto-sync config parser surfaces this at config load rather than letting git reject the ref.
Source
Thrown at gitnexus/src/core/auto-sync/config.ts:354
if (/[\s\0-\x1f\x7f]/.test(branch))
throw new Error('must not contain whitespace or control characters');
if (/[~^:?*[\\]/.test(branch)) throw new Error('contains characters not allowed in a git ref');
if (branch.startsWith('-')) throw new Error('must not start with "-"');
if (branch.startsWith('/')) throw new Error('must not start with "/"');
if (branch.includes('..')) throw new Error('must not contain ".."');
if (branch.includes('`')) throw new Error('must not contain backticks');
if (branch.endsWith('/') || branch.endsWith('.')) throw new Error('must not end with "/" or "."');
if (branch.includes('//')) throw new Error('must not contain consecutive slashes');
if (branch.includes('@{')) throw new Error('must not contain "@{"');
if (
branch
.split('/')
.some(
(component) =>
component.startsWith('.') || component.endsWith('.') || component.endsWith('.lock'),
)
)
throw new Error('must not contain hidden, trailing-dot, or .lock path components');
}
export function parseDurationMs(value: unknown): number {
if (typeof value === 'number') return value * 1_000;
const raw = String(value ?? '').trim();
const match = /^(\d+)(ms|s|m)?$/.exec(raw);
if (!match) return Number.NaN;
const amount = Number(match[1]);
const unit = match[2] ?? 's';
if (unit === 'ms') return amount;
if (unit === 's') return amount * 1_000;
return amount * 60_000;
}
View on GitHub (pinned to 0d1aed942f)
Solutions
- Rename the offending component: remove the leading dot, trailing dot, or ".lock" suffix.
- Pick a conventional branch name without path-like hidden segments.
- Re-run parseAutoSyncConfig to confirm the name validates.
Example fix
// before branch: ".work/release.lock" // after branch: "work/release"
Defensive patterns
Strategy: validation
Validate before calling
const bad = branch.split('/').some(c => c.startsWith('.') || c.endsWith('.') || c.endsWith('.lock'));
if (bad) throw new Error('branch name has hidden, trailing-dot, or .lock components'); Prevention
- Use plain alphanumeric/hyphen/underscore branch names; avoid path-like names entirely.
- Never copy file paths or lockfile names into branch-name config fields.
- Validate against git's check-ref-format rules in CI before deployment.
When it happens
Trigger: parseAutoSyncConfig receives a branch value where any path component is hidden (".work/feature"), ends with a dot ("feature./main"), or ends with ".lock" ("release.lock").
Common situations: Users copying file paths into the branch field (".github/workflows"), lockfile names accidentally used as branches, or names with trailing dots from Windows-style edits.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- must not contain backticks
- must not end with "/" or "."
- must not contain consecutive slashes
- must not contain "@{"
- must not include query strings or fragments
AI-assisted analysis of abhigyanpatwari/GitNexus@0d1aed942f (2026-09-08).
Data as JSON: /api/errors/388f8571ee321f57.
Report an issue: GitHub.