Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrisbin committed Nov 19, 2024
1 parent 60d5914 commit dde555b
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions run/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
});
});
}


/***/ }),
Expand Down Expand Up @@ -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++;
Expand All @@ -11723,15 +11709,15 @@ function parseGitPatch(patch) {
fileData.modifiedLines.push({
added: true,
lineNumber: nB,
line: line.substr(1),
line: line.substring(1),
});
}
else if (line.startsWith('-')) {
nB--;
fileData.modifiedLines.push({
added: false,
lineNumber: nA,
line: line.substr(1),
line: line.substring(1),
});
}
});
Expand Down

0 comments on commit dde555b

Please sign in to comment.