()
| 3482 | }> = []; |
| 3483 | |
| 3484 | const rollbackCreatedWorkspaces = async (): Promise<void> => { |
| 3485 | for (const createdWorkspace of [...createdWorkspaces].reverse()) { |
| 3486 | const trusted = |
| 3487 | configSnapshot.projects.get(stripTrailingSlashes(createdWorkspace.project.projectPath)) |
| 3488 | ?.trusted ?? false; |
| 3489 | try { |
| 3490 | // Rollback only removes the just-created workspace path; forcing deletion could |
| 3491 | // also drop an older same-named branch in worktree runtimes. |
| 3492 | await createdWorkspace.runtime.deleteWorkspace( |
| 3493 | createdWorkspace.project.projectPath, |
| 3494 | branchName, |
| 3495 | false, |
| 3496 | initAbortController.signal, |
| 3497 | trusted |
| 3498 | ); |
| 3499 | } catch (error: unknown) { |
| 3500 | log.error("Failed to roll back multi-project workspace creation", { |
| 3501 | workspaceId, |
| 3502 | projectPath: createdWorkspace.project.projectPath, |
| 3503 | error: getErrorMessage(error), |
| 3504 | }); |
| 3505 | } |
| 3506 | } |
| 3507 | }; |
| 3508 | |
| 3509 | for (const projectRuntimeEntry of projectRuntimeEntries) { |
| 3510 | const trusted = |
nothing calls this directly
no test coverage detected