MCPcopy Create free account
hub / github.com/cloudflare/computer / diffSummaryWith

Function diffSummaryWith

packages/computer/src/git/diff.ts:134–142  ·  view source on GitHub ↗
(opts: DiffWithDeps)

Source from the content-addressed store, hash-verified

132 * Backs `git diff --stat` / `--name-only` / `--name-status`.
133 */
134export 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

Callers 2

diffSummaryFunction · 0.85
summaryFunction · 0.85

Calls 2

collectDiffEntriesFunction · 0.85
countChangesFunction · 0.85

Tested by 1

summaryFunction · 0.68