{"record":{"id":"4e3de304df33ffb4","repo":"Fission-AI/OpenSpec","slug":"store-git-init-failed","errorCode":"store_git_init_failed","errorMessage":"Failed to initialize Git repository: ${error instanceof Error ? error.message : String(error)}","messagePattern":"Failed to initialize Git repository: (.+?)","errorType":"error_code","errorClass":"StoreError","httpStatus":null,"severity":"error","filePath":"src/core/store/git.ts","lineNumber":44,"sourceCode":"\nexport async function isGitRepositoryAtRoot(storeRoot: string): Promise<boolean> {\n  try {\n    const stat = await fs.stat(path.join(storeRoot, '.git'));\n    return stat.isDirectory() || stat.isFile();\n  } catch {\n    return false;\n  }\n}\n\nexport async function initGitRepository(storeRoot: string): Promise<boolean> {\n  if (await isGitRepositoryAtRoot(storeRoot)) {\n    return false;\n  }\n\n  try {\n    await execFileAsync('git', ['init'], { cwd: storeRoot });\n  } catch (error) {\n    throw new StoreError(\n      `Failed to initialize Git repository: ${error instanceof Error ? error.message : String(error)}`,\n      'store_git_init_failed',\n      {\n        target: 'store.git',\n        fix: 'Install Git or rerun setup with --no-init-git.',\n      }\n    );\n  }\n\n  return true;\n}\n\n/**\n * `git var` resolves identity exactly as `git commit` would (config, env vars,\n * auto-detection), so this fails precisely when the initial commit would.\n */\nexport async function assertGitCommitIdentity(probeCwd: string): Promise<void> {\n  for (const identVar of ['GIT_COMMITTER_IDENT', 'GIT_AUTHOR_IDENT']) {","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/store/git.ts#L26-L62","documentation":"Error \"Failed to initialize Git repository: ${error instanceof Error ? error.message : String(error)}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/store/git.ts:44 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}