refactor(projects): remove duplicate origin lookup

Amp-Thread-ID: https://ampcode.com/threads/T-019ff438-3b93-77b8-9828-1d3c586cb127
This commit is contained in:
Amp
2026-08-12 04:38:44 +00:00
committed by Peter Steinberger
parent 57a3392042
commit 04a94ba69f
2 changed files with 1 additions and 16 deletions
+1 -4
View File
@@ -9,7 +9,6 @@ import { withOpenClawStateLease } from "../state/openclaw-state-lease.js";
import { cloneProjectCheckout, ProjectCloneError } from "./project-clone-runtime.js";
import { parseProjectGitUrl } from "./project-git-url.js";
import {
findProjectRegistryByOrigin,
listProjectRegistry,
registerClonedProjectRegistry,
type ProjectRegistryRecord,
@@ -64,9 +63,7 @@ export async function materializeProjectClone(
operationLabel: "projects.clone.lease",
},
async (lease) => {
const raced =
existingCanonicalProject(input.cfg, parsed.url, options) ??
findProjectRegistryByOrigin(parsed.url, options);
const raced = existingCanonicalProject(input.cfg, parsed.url, options);
if (raced) {
return raced;
}
-12
View File
@@ -224,18 +224,6 @@ export async function registerClonedProjectRegistry(
);
}
export function findProjectRegistryByOrigin(
originUrl: string,
options: OpenClawStateDatabaseOptions = {},
): ProjectRegistryRecord | undefined {
const { sqlite, kysely } = openProjectsDatabase(options);
const row = executeSqliteQueryTakeFirstSync(
sqlite,
kysely.selectFrom("projects").selectAll().where("origin_url", "=", originUrl),
);
return row ? rowToProject(row) : undefined;
}
export function listProjectRegistry(
cfg: OpenClawConfig,
options: OpenClawStateDatabaseOptions = {},