(path: string)
| 161 | } |
| 162 | |
| 163 | private async openCheckoutWorkspace(path: string): Promise<WorkspaceContext> { |
| 164 | const root = assertAllowedPath(path, this.config.allowedRoots); |
| 165 | await mkdir(root, { recursive: true }); |
| 166 | |
| 167 | const rootStats = await stat(root); |
| 168 | if (!rootStats.isDirectory()) { |
| 169 | throw new Error(`Workspace root must be a directory: ${path}`); |
| 170 | } |
| 171 | |
| 172 | return this.createWorkspaceContext({ root, mode: "checkout" }); |
| 173 | } |
| 174 | |
| 175 | private async openWorktreeWorkspace(path: string, baseRef: string | undefined): Promise<WorkspaceContext> { |
| 176 | const worktree = await createManagedWorktree({ |
no test coverage detected