MCPcopy Create free account
hub / github.com/apache/maka / applyPatch

Method applyPatch

packages/runtime/src/workspace-executor.ts:279–294  ·  view source on GitHub ↗
(input: WorkspaceApplyPatchInput)

Source from the content-addressed store, hash-verified

277 }
278
279 async applyPatch(input: WorkspaceApplyPatchInput): Promise<WorkspaceApplyPatchResult> {
280 if (input.action !== 'update') {
281 const path = await resolveDirectoryEntryPathInScope(
282 input.cwd,
283 input.path,
284 input.label,
285 input.scope,
286 );
287 if (input.action === 'create') await createPatchedFile(path, input.diff);
288 else await fs.unlink(path);
289 return { ok: true, path };
290 }
291 const path = await resolveExistingPathInScope(input.cwd, input.path, input.label, input.scope);
292 await updatePatchedFile(path, input.diff);
293 return { ok: true, path };
294 }
295
296 async resolveExistingPath(input: WorkspaceResolvePathInput): Promise<WorkspaceResolvePathResult> {
297 return {

Callers

nothing calls this directly

Calls 4

createPatchedFileFunction · 0.85
updatePatchedFileFunction · 0.85

Tested by

no test coverage detected