* Rebase 工作空间分支到最新的基础分支
(id: string)
| 1784 | where: { id: workspace.id, task: { deletedAt: null } }, |
| 1785 | data: { |
| 1786 | status: WorkspaceStatus.ACTIVE, |
| 1787 | worktreePath, |
| 1788 | workingDir: worktreePath, |
| 1789 | hibernatedAt: null, |
| 1790 | }, |
| 1791 | }); |
| 1792 | if (updateResult.count === 0) { |
| 1793 | await this.cleanupRestoredWorktree(worktreeManager, worktreePath); |
| 1794 | throw new NotFoundError('Task', workspace.taskId); |
| 1795 | } |
| 1796 | |
| 1797 | this.runCopyFiles(workspace.task.project.repoPath, worktreePath, workspace.task.project.copyFiles); |
| 1798 | this.fireSetupScript(workspace.id, workspace.taskId, worktreePath, workspace.task.project.setupScript); |
| 1799 | |
| 1800 | const restored = await prisma.workspace.findUniqueOrThrow({ |
| 1801 | where: { id: workspace.id }, |
| 1802 | include: { sessions: visibleSessionsFilter, task: { include: { project: true } } }, |
| 1803 | }); |
| 1804 | return restored; |
| 1805 | } |
| 1806 |
no test coverage detected