feat: import prepared Catalog bindings through authenticated services
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
WorkspaceRepositoryLock,
|
||||
normalizeRepositoryIdentity,
|
||||
type GitStatus,
|
||||
type PreparedWorkspaceSource,
|
||||
} from "./git-repository.js";
|
||||
import {
|
||||
parseWorkspaceYaml,
|
||||
@@ -121,6 +122,19 @@ export class WorkspaceRegistry {
|
||||
});
|
||||
}
|
||||
|
||||
async prepareInstallation(expected: PreparedWorkspaceSource): Promise<{ revision: string }> {
|
||||
await this.repository.ensureLayout();
|
||||
return await this.lock.run(async () => {
|
||||
const head = await this.repository.verifyPrepared(expected);
|
||||
const active = await this.tryActiveState();
|
||||
if (active && active.head !== head) {
|
||||
throw new WorkspaceRegistryError("workspace_stale", "Reconcile the active workspace revision before installation.");
|
||||
}
|
||||
if (!active) await this.activate(head);
|
||||
return { revision: head };
|
||||
});
|
||||
}
|
||||
|
||||
async pull(): Promise<GitStatus> {
|
||||
await this.repository.ensureLayout();
|
||||
return await this.lock.run(async () => {
|
||||
|
||||
Reference in New Issue
Block a user