| 368 | async getDiff(worktreePath: string, baseBranch: string): Promise<string>; |
| 369 | async getDiff(worktreePath: string, baseBranch: string, options: { withStat: true }): Promise<DiffResult>; |
| 370 | async getDiff( |
| 371 | worktreePath: string, |
| 372 | baseBranch: string, |
| 373 | options?: { withStat: boolean } |
| 374 | ): Promise<string | DiffResult> { |
| 375 | const diff = await execGit(worktreePath, ['diff', baseBranch]); |
| 376 | |
| 377 | if (options?.withStat) { |
| 378 | const stat = await execGit(worktreePath, ['diff', '--stat', baseBranch]); |
| 379 | return { diff, stat }; |
| 380 | } |
| 381 | |
| 382 | return diff; |
| 383 | } |
| 384 | |
| 385 | /** |
| 386 | * Squash-merge a worktree branch into the target branch. |