{"record":{"id":"388f8571ee321f57","repo":"abhigyanpatwari/GitNexus","slug":"must-not-contain-hidden-trailing-dot-or-lock-pa","errorCode":null,"errorMessage":"must not contain hidden, trailing-dot, or .lock path components","messagePattern":"must not contain hidden, trailing-dot, or \\.lock path components","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"gitnexus/src/core/auto-sync/config.ts","lineNumber":354,"sourceCode":"  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';\n  if (unit === 'ms') return amount;\n  if (unit === 's') return amount * 1_000;\n  return amount * 60_000;\n}\n","sourceCodeStart":336,"sourceCodeEnd":368,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/0d1aed942f0e8b5d3bac27519fff441aceea722d/gitnexus/src/core/auto-sync/config.ts#L336-L368","documentation":"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.","triggerScenarios":"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\").","commonSituations":"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.","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."],"exampleFix":"// before\nbranch: \".work/release.lock\"\n// after\nbranch: \"work/release\"","handlingStrategy":"validation","validationCode":"const bad = branch.split('/').some(c => c.startsWith('.') || c.endsWith('.') || c.endsWith('.lock'));\nif (bad) throw new Error('branch name has hidden, trailing-dot, or .lock components');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"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"}