MCPcopy Index your code
hub / github.com/bigcode-project/jupytercoder / loadPatch

Function loadPatch

src/diff.js:1206–1220  ·  view source on GitHub ↗
(param, base)

Source from the content-addressed store, hash-verified

1204 }
1205
1206 function loadPatch(param, base) {
1207 if (typeof param === 'string') {
1208 if (/^@@/m.test(param) || /^Index:/m.test(param)) {
1209 return parsePatch(param)[0];
1210 }
1211
1212 if (!base) {
1213 throw new Error('Must provide a base reference or pass in a patch');
1214 }
1215
1216 return structuredPatch(undefined, undefined, base, param);
1217 }
1218
1219 return param;
1220 }
1221
1222 function fileNameChanged(patch) {
1223 return patch.newFileName && patch.newFileName !== patch.oldFileName;

Callers 1

mergeFunction · 0.85

Calls 2

parsePatchFunction · 0.85
structuredPatchFunction · 0.85

Tested by

no test coverage detected