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

Function diffWith

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

Source from the content-addressed store, hash-verified

117}
118
119export async function diffWith(opts: DiffWithDeps): Promise<string> {
120 const entries = await collectDiffEntries(opts);
121 const chunks: string[] = [];
122 for (const e of entries) {
123 const patch = opts.createPatch(e.path, e.oldText, e.newText, "", "");
124 if (patch.trim().length > 0) chunks.push(patch);
125 }
126 return chunks.join("\n");
127}
128
129/**
130 * Per-file summary of the same change set `diffWith` renders,

Callers 4

diffFunction · 0.85
runDiffFunction · 0.85
diff.test.tsFile · 0.85
runRefDiffFunction · 0.85

Calls 2

collectDiffEntriesFunction · 0.85
pushMethod · 0.65

Tested by 2

runDiffFunction · 0.68
runRefDiffFunction · 0.68