Skip to content

Commit edcf12f

Browse files
committed
Fix behavior of complete conflicts
we should guard against cases where there are 0 matchings when generating an LCS.
1 parent 4d2fdfa commit edcf12f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

diff3.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,18 @@ function longestCommonSubsequence(file1, file2) {
5858
}
5959
}
6060

61-
prev.chain = {
61+
var tail = {
6262
file1index: -1,
6363
file2index: -1,
6464
chain: null
6565
};
6666

67+
if (!prev) {
68+
return tail;
69+
}
70+
71+
prev.chain = tail;
72+
6773
return root;
6874
}
6975

0 commit comments

Comments
 (0)