{"record":{"id":"c9782a59f0bc5ef0","repo":"Fission-AI/OpenSpec","slug":"store-git-commit-failed","errorCode":"store_git_commit_failed","errorMessage":"Failed to create the initial store commit: ${error instanceof Error ? error.message : String(error)}","messagePattern":"Failed to create the initial store commit: (.+?)","errorType":"error_code","errorClass":"StoreError","httpStatus":null,"severity":"error","filePath":"src/core/store/git.ts","lineNumber":117,"sourceCode":"  if (pathspecs.length === 0) {\n    return false;\n  }\n\n  try {\n    await execFileAsync('git', ['add', '--', ...pathspecs], { cwd: storeRoot });\n    await execFileAsync(\n      'git',\n      ['commit', '-m', `Initialize OpenSpec store ${id}`, '--', ...pathspecs],\n      { cwd: storeRoot }\n    );\n  } catch (error) {\n    // Best-effort unstage so a failed commit (gpg signing, hooks) does not\n    // leave setup's files in the user's index after rollback deletes them.\n    await execFileAsync('git', ['rm', '--cached', '-r', '-f', '-q', '--', ...pathspecs], {\n      cwd: storeRoot,\n    }).catch(() => undefined);\n\n    throw new StoreError(\n      `Failed to create the initial store commit: ${error instanceof Error ? error.message : String(error)}`,\n      'store_git_commit_failed',\n      {\n        target: 'store.git',\n        fix: 'Commit the created files manually, or rerun setup with --no-init-git.',\n      }\n    );\n  }\n\n  return true;\n}\n\nasync function gitProbe(storeRoot: string, args: string[]): Promise<string | null> {\n  try {\n    const { stdout } = await execFileAsync('git', ['-C', storeRoot, ...args]);\n    return stdout;\n  } catch {\n    return null;","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/store/git.ts#L99-L135","documentation":"Error \"Failed to create the initial store commit: ${error instanceof Error ? error.message : String(error)}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/store/git.ts:117 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"}