| 132 | * Backs `git diff --stat` / `--name-only` / `--name-status`. |
| 133 | */ |
| 134 | export async function diffSummaryWith(opts: DiffWithDeps): Promise<DiffSummaryEntry[]> { |
| 135 | const entries = await collectDiffEntries(opts); |
| 136 | return entries.map((e) => { |
| 137 | const { insertions, deletions } = countChanges( |
| 138 | opts.createPatch(e.path, e.oldText, e.newText, "", ""), |
| 139 | ); |
| 140 | return { path: e.path, status: e.status, insertions, deletions }; |
| 141 | }); |
| 142 | } |
| 143 | |
| 144 | // Shared traversal. Working-tree mode walks the status matrix; |
| 145 | // ref-to-ref mode walks the union of both trees' files. Both |