Skip to content

Commit

Permalink
Support patches with empty lines
Browse files Browse the repository at this point in the history
Ignore empty line at end of patch file as it's not really part of the patch
  • Loading branch information
bp-dev authored and kpdecker committed Mar 5, 2018
1 parent e24d789 commit 196d3aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/patch/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function parsePatch(uniDiff, options = {}) {
&& diffstr[i + 2].indexOf('@@') === 0) {
break;
}
let operation = diffstr[i].length>0 ? diffstr[i][0] : ' ';
let operation = (diffstr[i].length==0 && i!=diffstr.length-1) ? ' ' : diffstr[i][0];

if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
hunk.lines.push(diffstr[i]);
Expand Down

0 comments on commit 196d3aa

Please sign in to comment.