log -L: fix overlapping input ranges
commit209618860c2627a4e134a15472587c574b328b40
authorThomas Rast <trast@inf.ethz.ch>
Fri, 5 Apr 2013 14:34:48 +0000 (5 16:34 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Apr 2013 17:39:09 +0000 (5 10:39 -0700)
treec0c33f379053fb4150b1dbfc1fd506a925c948a4
parent4596f190d384872305e502ebece2e38358ba463e
log -L: fix overlapping input ranges

The existing code was too defensive, and would trigger the assert in
range_set_append() if the user gave overlapping ranges.

The intent was always to define overlapping ranges as just the union
of all of them, as evidenced by the call to sort_and_merge_range_set().
(Which was already used, unlike what the comment said.)

Fix by splitting out the meat of range_set_append() to a new _unsafe()
function that lacks the paranoia.  sort_and_merge_range_set will fix
up the ranges, so we don't need the checks there.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
line-log.c
t/t4211-line-log.sh
t/t4211/expect.multiple [new file with mode: 0644]
t/t4211/expect.multiple-overlapping [new file with mode: 0644]
t/t4211/expect.multiple-superset [new file with mode: 0644]