Fix some empty interdiffs resulting in a single equals chunk.
Review Request #6484 — Created Oct. 21, 2014 and submitted — Latest diff uploaded
MyersDiffer had a bug where, if given an empty set of strings to
compare, it would yield an equal chunk. This could happen with
interdiffs when dealing with two deleted files, since both would end up
with empty strings.The assumption was that if we reached the end of the processing and
haven't yielded anything, that it's an equal file. We'd then yield an
equal chunk with the ranges. In this case, the ranges would be 0,
causing index errors and bad assumptions later on. We now check for this
early and just bail.
Tested with some deleted files, which previously resulted in a single empty
chunk, causing an IndexError. After this, there were no chunks.