Fission-AI/OpenSpec · error · StoreError

store_git_init_failed

store_git_init_failed

Error message

Failed to initialize Git repository: ${error instanceof Error ? error.message : String(error)}

What it means

Error "Failed to initialize Git repository: ${error instanceof Error ? error.message : String(error)}" thrown in Fission-AI/OpenSpec.

Source

Thrown at src/core/store/git.ts:44

export async function isGitRepositoryAtRoot(storeRoot: string): Promise<boolean> {
  try {
    const stat = await fs.stat(path.join(storeRoot, '.git'));
    return stat.isDirectory() || stat.isFile();
  } catch {
    return false;
  }
}

export async function initGitRepository(storeRoot: string): Promise<boolean> {
  if (await isGitRepositoryAtRoot(storeRoot)) {
    return false;
  }

  try {
    await execFileAsync('git', ['init'], { cwd: storeRoot });
  } catch (error) {
    throw new StoreError(
      `Failed to initialize Git repository: ${error instanceof Error ? error.message : String(error)}`,
      'store_git_init_failed',
      {
        target: 'store.git',
        fix: 'Install Git or rerun setup with --no-init-git.',
      }
    );
  }

  return true;
}

/**
 * `git var` resolves identity exactly as `git commit` would (config, env vars,
 * auto-detection), so this fails precisely when the initial commit would.
 */
export async function assertGitCommitIdentity(probeCwd: string): Promise<void> {
  for (const identVar of ['GIT_COMMITTER_IDENT', 'GIT_AUTHOR_IDENT']) {

View on GitHub (pinned to 6926ccb18a)

When it happens

Trigger: Thrown at src/core/store/git.ts:44 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/4e3de304df33ffb4. Report an issue: GitHub.