Fix SparseFileContent for delete-only patches

If an edit list is only deletion regions, the B side will wind up
with an empty range as there is no new content to include in the
file.  This is a corner case that means we have to always return
false from contains(int) when there is no content.

Change-Id: I745fa9ce2071acc2aa83bd84909477afeef0c3d4
Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2010-02-24 10:45:30 -08:00
parent 099d70ec62
commit ad34e3b266

View File

@@ -170,6 +170,10 @@ public class SparseFileContent {
// Binary search for the range, since we know its a sorted list.
//
if (ranges.isEmpty()) {
return null;
}
int low = 0;
do {
final int mid = (low + high) / 2;