MCPcopy Create free account
hub / github.com/promptfoo/promptfoo / generatePatches

Function generatePatches

src/codeScan/git/diffProcessor.ts:424–450  ·  view source on GitHub ↗
(
  repoPath: string,
  base: string,
  compare: string,
  files: FileRecord[],
)

Source from the content-addressed store, hash-verified

422}
423
424async function generatePatches(
425 repoPath: string,
426 base: string,
427 compare: string,
428 files: FileRecord[],
429): Promise<FileRecord[]> {
430 return async.mapLimit(files, PATCH_CONCURRENCY, async (file: FileRecord) => {
431 if (file.skipReason) {
432 return file;
433 }
434
435 const result = await generatePatchForFile(repoPath, base, compare, file.path);
436
437 if (!result.success) {
438 return {
439 ...file,
440 skipReason: result.skipReason,
441 };
442 }
443
444 return {
445 ...file,
446 patch: result.patch,
447 lineRanges: result.lineRanges,
448 };
449 });
450}
451
452export async function processDiff(
453 repoPath: string,

Callers 1

processDiffFunction · 0.85

Calls 1

generatePatchForFileFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…