MCPcopy Create free account
hub / github.com/agent-tower/core / rebase

Method rebase

packages/server/src/services/workspace.service.ts:1786–1803  ·  view source on GitHub ↗

* Rebase 工作空间分支到最新的基础分支

(id: string)

Source from the content-addressed store, hash-verified

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

Callers 2

workspaceRoutesFunction · 0.95

Calls 4

rebaseMethod · 0.95
getBaseBranchMethod · 0.95
ensureProjectIsMutableFunction · 0.85

Tested by

no test coverage detected