coleam00/Archon · error

Path is not a git repository: ${localPath} (${(error as Erro

Error message

Path is not a git repository: ${localPath} (${(error as Error).message})

What it means

Error "Path is not a git repository: ${localPath} (${(error as Error).message})" thrown in coleam00/Archon.

Source

Thrown at packages/core/src/handlers/clone.ts:413

  // Add to git safe.directory
  await execFileAsync('git', ['config', '--global', '--add', 'safe.directory', targetPath]);
  getLog().debug({ path: targetPath }, 'safe_directory_added');

  const result = await registerRepoAtPath(targetPath, `${ownerName}/${repoName}`, workingUrl);
  getLog().info({ url: workingUrl, targetPath }, 'clone_completed');
  return result;
}

/**
 * Register an existing local repository in the database (no git clone).
 */
export async function registerRepository(localPath: string): Promise<RegisterResult> {
  // Validate path exists and is a git repo
  try {
    await execFileAsync('git', ['-C', localPath, 'rev-parse', '--git-dir']);
  } catch (error) {
    throw new Error(`Path is not a git repository: ${localPath} (${(error as Error).message})`);
  }

  // Git's physical common directory proves linked-checkout ownership without
  // conflating separate clones, remotes, names, or branches (#1192).
  const existing = await findCodebaseForCheckoutPath(localPath);
  if (existing) {
    return {
      codebaseId: existing.id,
      name: existing.name,
      repositoryUrl: existing.repository_url,
      defaultCwd: existing.default_cwd,
      defaultBranch: existing.default_branch ?? null,
      commandCount: 0,
      alreadyExisted: true,
    };
  }

  // Get remote URL (optional — local-only repos may not have one)

View on GitHub (pinned to 0773b97458)

When it happens

Trigger: Thrown at packages/core/src/handlers/clone.ts:413 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/d217004c8dd8fa32. Report an issue: GitHub.