ASSERT-KTH/spork

Spork's line-based merge reports a conflict if the base revision is the empty string

Closed this issue · 0 comments

Essentially, if the base revision in the line-based merge is the empty string, then Spork always reports a conflict between the left and right revision. This is a false positive if either the left or right revision is also the empty string, because then the non-empty revision is the unambiguous merge resolution; it's just an addition!

This very rarely has an effect as the line-based merge is almost never invoked if the base revision is the empty string. There's one big exception to this, and that is when the left or right revision adds a file header.

I'm not sure why the line-based merge reports a conflict when this happens (it's down to the JGit library), but fixing it is trivial: just check if the base revision and either the left or right revision is empty, and return the non-empty revision.