im_wower
·
2026-03-21
index.ts
1export interface WorktreeSpec {
2 repoPath: string;
3 taskId: string;
4 branchName: string;
5 baseRef: string;
6}
7
8export interface GitCommandPlan {
9 description: string;
10 commands: string[];
11}
12
13export function createWorktreeCommandPlan(spec: WorktreeSpec): GitCommandPlan {
14 return {
15 description: `为 ${spec.taskId} 创建 worktree`,
16 commands: [
17 `git -C ${spec.repoPath} worktree add ${spec.repoPath}/worktrees/${spec.taskId} -b ${spec.branchName} ${spec.baseRef}`
18 ]
19 };
20}
21