* 更新项目
(id: string, input: UpdateProjectInput)
| 364 | input.initEmptyRepo ?? false |
| 365 | ); |
| 366 | |
| 367 | try { |
| 368 | const capability = await detectProjectGitCapability(resolvedPath); |
| 369 | const gitCapabilityCheckedAt = new Date(); |
| 370 | const created = await prisma.project.create({ |
| 371 | data: { |
| 372 | name: input.name, |
| 373 | description: input.description, |
| 374 | repoPath: resolvedPath, |
| 375 | repoRemoteUrl, |
| 376 | mainBranch: input.mainBranch || 'main', |
| 377 | copyFiles: input.copyFiles, |
| 378 | setupScript: input.setupScript, |
| 379 | quickCommands: input.quickCommands, |
| 380 | isGitRepo: capability.isGitRepo, |
| 381 | worktreeReady: capability.worktreeReady, |
| 382 | gitCapabilityReason: capability.reason, |
| 383 | gitCapabilityCheckedAt, |
| 384 | }, |
| 385 | }); |
| 386 | return this.withGitMetadata(created); |
| 387 | } catch (error) { |
| 388 | if (initialized) { |
| 389 | await removeGitMetadata(resolvedPath); |
| 390 | } |
| 391 | throw error; |
| 392 | } |
| 393 | } |
| 394 |
no test coverage detected