3-way merge - correct output of CONFLICT_PRODUCES_MERGE_CONFLICT
Describe the bug I suspect CONFLICT_PRODUCES_MERGE_CONFLICT does not produce correct output.
To Reproduce Steps to reproduce the behavior:
- Example data BASE Imagine there's no heaven LEFT Imagine there's no HEAVEN RIGHT IMAGINE there's no heaven
- Sample code
Patch<String> rightPatch = diff(split(base), split(right))
.withConflictOutput(CONFLICT_PRODUCES_MERGE_CONFLICT );
List<String> applied = rightPatch.applyTo(split(left));
return Joiner.on("\r\n").join(applied)
Expected behavior
<<<<<< HEAD
Imagine there's no HEAVEN
======
IMAGINE there's no heaven
>>>>>>> PATCH
Actual behavior
<<<<<< HEAD
Imagine there's no HEAVEN
======
Imagine there's no heaven
>>>>>>> PATCH
That is, it seems that the other part of the conflict, it displays the base, instead of the second downstream, version.
Introduced your test but could not reproduce your behaviour.
Since there is no context specified, my test successfully can apply this patch to the left text and it results in:
IMAGINE there's no HEAVEN
Doesn't it process the input line by line? To merge this conflict, you would need to process the line word-wise? Because line-wise, it clearly is a conflict, isnt't it?
Stale issue message