diff --git a/src/core/hydrate.ts b/src/core/hydrate.ts index aab86bd..651945b 100644 --- a/src/core/hydrate.ts +++ b/src/core/hydrate.ts @@ -8,7 +8,6 @@ import { PLACEHOLDER_DIR, readPlaceholder, writePlaceholder, - type PlaceholderMeta, } from "./placeholder"; import { quoteUserValue, sanitizeUserText } from "./userErrors"; @@ -16,11 +15,7 @@ export type HydrateOutcome = "hydrated" | "hydrated-checkout-failed" | "already- /** Optional callbacks so callers can report progress without the core logging itself. */ export interface HydrateHooks { - onPlaceholderFound?(meta: PlaceholderMeta): void; - onCloned?(remoteUrl: string): void; onCheckedOut?(branch: string): void; - onCheckoutFailed?(branch: string): void; - onUpdated?(): void; } function hydrationLockPath(repoDir: string): string { @@ -91,8 +86,6 @@ export async function hydratePlaceholder( `${quoteUserValue(label, 500)} does not contain repository download information (.boot/repo.json). Run \`boot pull\` from the workspace root to recreate it.`, ); } - hooks.onPlaceholderFound?.(meta); - if (!meta.remoteUrl) { throw new Error( `Repository ${quoteUserValue(meta.name)} has no URL, so it cannot be downloaded. Add its URL to \`boot.yaml\`, then run \`boot up .\` from the workspace root.`, @@ -125,8 +118,6 @@ export async function hydratePlaceholder( ); } - hooks.onCloned?.(meta.remoteUrl); - await excludePlaceholderFromGit(clonePath); await writePlaceholder(clonePath, { ...meta, hydrateStatus: "hydrated" }); @@ -149,10 +140,8 @@ export async function hydratePlaceholder( hooks.onCheckedOut?.(meta.branch); } catch { checkoutFailed = true; - hooks.onCheckoutFailed?.(meta.branch); } } - hooks.onUpdated?.(); return checkoutFailed ? "hydrated-checkout-failed" : "hydrated"; }, diff --git a/src/tests/hydrate.test.ts b/src/tests/hydrate.test.ts index 1812333..6d3c1d2 100644 --- a/src/tests/hydrate.test.ts +++ b/src/tests/hydrate.test.ts @@ -117,19 +117,15 @@ describe("hydrateCommand", () => { it("returns a distinct outcome when clone succeeds but checkout fails", async () => { const repoDir = await makePlaceholder("apps/mismatch", "git@example.com:mismatch.git"); - const failedBranches: string[] = []; cloneMock.mockImplementation(async (_url: string, target: string) => { await fs.mkdir(path.join(target, ".git"), { recursive: true }); await fs.writeFile(path.join(target, "README.md"), "# mismatch\n"); }); checkoutMock.mockRejectedValue(new Error("branch not found")); - const outcome = await hydratePlaceholder(repoDir, { - onCheckoutFailed: (branch) => failedBranches.push(branch), - }); + const outcome = await hydratePlaceholder(repoDir); expect(outcome).toBe("hydrated-checkout-failed"); - expect(failedBranches).toEqual(["main"]); expect((await readPlaceholder(repoDir))?.hydrateStatus).toBe("hydrated"); });