From dde555b2709e37ad334a0ed272c193fa51de8b66 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Tue, 19 Nov 2024 09:21:37 -0500 Subject: [PATCH] Build --- run/dist/index.js | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/run/dist/index.js b/run/dist/index.js index 0d9d0f6..5e9d242 100644 --- a/run/dist/index.js +++ b/run/dist/index.js @@ -474,7 +474,7 @@ function parsePatches(str) { if (patchLines.length === 0) { return; } - const parsed = parsePatch(patchLines.join("\n")); + const parsed = (0, parse_git_patch_1.default)(patchLines.join("\n")); if (!parsed) { return; } @@ -490,20 +490,6 @@ function parsePatches(str) { accumulate(); return patches; } -function parsePatch(str) { - const p = (0, parse_git_patch_1.default)(str); - if (p) { - fixLineNumbers(p); - } - return p; -} -function fixLineNumbers(patch) { - patch.files.forEach((file) => { - file.modifiedLines.forEach((mod) => { - mod.lineNumber = mod.lineNumber - 1; - }); - }); -} /***/ }), @@ -11710,8 +11696,8 @@ function parseGitPatch(patch) { if (!match4) return; const [, a, b] = match4; - let nA = parseInt(a); - let nB = parseInt(b); + let nA = parseInt(a) - 1; + let nB = parseInt(b) - 1; lines.forEach(line => { nA++; nB++; @@ -11723,7 +11709,7 @@ function parseGitPatch(patch) { fileData.modifiedLines.push({ added: true, lineNumber: nB, - line: line.substr(1), + line: line.substring(1), }); } else if (line.startsWith('-')) { @@ -11731,7 +11717,7 @@ function parseGitPatch(patch) { fileData.modifiedLines.push({ added: false, lineNumber: nA, - line: line.substr(1), + line: line.substring(1), }); } });