• E
    line-log: fix "log -LN" crash when N is last line of file · df6308eb
    Eric Sunshine 提交于
    range-set invariants are: ranges must be (1) non-empty, (2) disjoint,
    (3) sorted in ascending order.
    
    line_log_data_insert() breaks the non-empty invariant under the
    following conditions: the incoming range is empty and the pathname
    attached to the range has not yet been encountered. In this case,
    line_log_data_insert() assigns the empty range to a new line_log_data
    record without taking any action to ensure that the empty range is
    eventually folded out.  Subsequent range-set functions crash or throw an
    assertion failure upon encountering such an anomaly.  Fix this bug.
    Signed-off-by: NEric Sunshine <sunshine@sunshineco.com>
    Acked-by: NThomas Rast <trast@inf.ethz.ch>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    df6308eb
line-log.c 31.0 KB