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

Method getDiff

packages/server/src/git/worktree.manager.ts:370–383  ·  view source on GitHub ↗
(
    worktreePath: string,
    baseBranch: string,
    options?: { withStat: boolean }
  )

Source from the content-addressed store, hash-verified

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.

Callers 1

getDiffMethod · 0.95

Calls 1

execGitFunction · 0.70

Tested by

no test coverage detected