Extracts variables out of a loop

This commit is contained in:
Paulo Bu 2015-10-20 10:55:22 +02:00
parent c5671a50f8
commit c1ea2cb3b2

View file

@ -119,13 +119,6 @@
};
var diffLines = diffInput.split('\n');
diffLines.forEach(function(line) {
// Unmerged paths, and possibly other non-diffable files
// https://github.com/scottgonzalez/pretty-diff/issues/11
// Also, remove some useless lines
if (!line || utils.startsWith(line, '*')) {
return;
}
/* Diff */
var oldMode = /^old mode (\d{6})/;
@ -149,6 +142,14 @@
var combinedNewFile = /^new file mode (\d{6})/;
var combinedDeletedFile = /^deleted file mode (\d{6}),(\d{6})/;
diffLines.forEach(function(line) {
// Unmerged paths, and possibly other non-diffable files
// https://github.com/scottgonzalez/pretty-diff/issues/11
// Also, remove some useless lines
if (!line || utils.startsWith(line, '*')) {
return;
}
var values = [];
if (utils.startsWith(line, 'diff')) {
startFile();