Open vptes1 opened 6 years ago
Hey @vptes1 this looks to be caused by the hunk-sorting bug #3 this is fixed by PR #4
I'm maintaining an updated version of this library that includes the fix: https://github.com/bhousel/node-diff3
When I run it, I get this:
$ node
> const Diff3 = require('.');
undefined
> Diff3.merge(
"one\n22222\nthree\n44\nfive\n6666",
"one\ntwo\nthree\nfour\nfive\nsix",
"one\nTTTTTT\nthree\nF\nfive\nSSSSS");
{
conflict: true,
result: [
'o',
'n',
'e',
'\n',
'\n<<<<<<<<<\n',
'22222',
'\n=========\n',
'TTTTTT',
'\n>>>>>>>>>\n',
'\n',
't',
'h',
'r',
'e',
'e',
'\n',
'\n<<<<<<<<<\n',
'44',
'\n=========\n',
'F',
'\n>>>>>>>>>\n',
'\n',
'f',
'i',
'v',
'e',
'\n',
'\n<<<<<<<<<\n',
'6666',
'\n=========\n',
'SSSSS',
'\n>>>>>>>>>\n'
]
}
currently returns
Is it just me or does it overlook the very first conflict, involving
two
?