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

Method merge

packages/server/src/services/workspace.service.ts:1857–1877  ·  view source on GitHub ↗
(id: string, commitMessageOrOptions?: string | MergeWorkspaceOptions)

Source from the content-addressed store, hash-verified

1855 // worktree 清理失败时记录警告但不阻断删除
1856 console.warn(
1857 `[WorkspaceService] Failed to remove worktree for workspace ${id}: ${err instanceof Error ? err.message : err}`
1858 );
1859 }
1860 }
1861
1862 // 删除数据库记录(级联删除 sessions/services)
1863 await this.backgroundService.releaseLogsForWorkspace?.(id);
1864 await prisma.workspace.delete({ where: { id } });
1865 return true;
1866 }
1867
1868 // ── Diff ─────────────────────────────────────────────────────────────────────
1869
1870 async getDiff(id: string) {
1871 const workspace = await prisma.workspace.findUnique({
1872 where: { id },
1873 include: { task: { include: { project: true } } },
1874 });
1875
1876 if (!workspace) {
1877 throw new NotFoundError('Workspace', id);
1878 }
1879 ensureProjectIsMutable(workspace.task.project, 'read workspace diff');
1880 this.assertWorktreeWorkspace(workspace);

Callers 8

workspaceRoutesFunction · 0.95
runMethod · 0.95
startMethod · 0.45
startFollowUpMethod · 0.45
sendMessageMethod · 0.45

Calls 4

withProjectMergeLockMethod · 0.95
mergeWithLockMethod · 0.95
ensureProjectIsMutableFunction · 0.85

Tested by

no test coverage detected