MCPcopy Create free account
hub / github.com/anomalyco/opencode / diffContentForFiles

Function diffContentForFiles

packages/opencode/src/acp/permission.ts:196–205  ·  view source on GitHub ↗
(files: PermissionFileMetadata[])

Source from the content-addressed store, hash-verified

194}
195
196async function diffContentForFiles(files: PermissionFileMetadata[]) {
197 const content = await Promise.all(
198 files.map(async (file) => {
199 if (!file.patch) return []
200 const content = await diffContentForPatch(file.filePath, file.patch, file.movePath)
201 return content ? [content] : []
202 }),
203 )
204 return content.flat()
205}
206
207async function diffContentForPatch(filepath: string, diff: string, displayPath = filepath) {
208 const content = (await exists(filepath)) ? await readText(filepath) : ""

Callers 1

permissionContentFunction · 0.85

Calls 2

diffContentForPatchFunction · 0.85
allMethod · 0.45

Tested by

no test coverage detected