summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2013-07-23 10:28:08 -0400
committerJunio C Hamano <gitster@pobox.com>2013-07-23 12:09:48 -0700
commitdf6308eb82bc9d2074b35387583548b8b153433d (patch)
tree4edf2970e95e0dcedb2d2e8b97c44d7ea15b3057 /t
parentf8395edc6f5c59a92adcf42ea20a01872ec22700 (diff)
downloadgit-df6308eb82bc9d2074b35387583548b8b153433d.tar.gz
line-log: fix "log -LN" crash when N is last line of filees/line-log-further-fixes
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: Eric Sunshine <sunshine@sunshineco.com> Acked-by: Thomas Rast <trast@inf.ethz.ch> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t4211-line-log.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh
index e7a6e49965..00a850d611 100755
--- a/t/t4211-line-log.sh
+++ b/t/t4211-line-log.sh
@@ -73,7 +73,7 @@ test_expect_success '-L {empty-range} (any -L)' '
git log -L1,1:b.c -L$n:b.c
'
-test_expect_failure '-L {empty-range} (first -L)' '
+test_expect_success '-L {empty-range} (first -L)' '
n=$(expr $(wc -l <b.c) + 1) &&
git log -L$n:b.c
'