diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-07-24 19:19:24 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-07-24 19:19:24 -0700 |
commit | 1762224ddb599ab14ca26cedafec39dee9b92fe5 (patch) | |
tree | 89ba13e49e5e65c5e80e69602cba166ddc543a5b /t/t4211-line-log.sh | |
parent | 6a907786af835ac15962be53f1492f23e044f479 (diff) | |
parent | d3a486c47d920efc183645766d762fd697c42088 (diff) | |
download | git-1762224ddb599ab14ca26cedafec39dee9b92fe5.tar.gz |
Merge branch 'tr/line-log'
Fix "log -L" command line parsing bugs.
* tr/line-log:
t4211: fix incorrect rebase at f8395edc (range-set: satisfy non-empty ranges invariant)
line-log: fix "log -LN" crash when N is last line of file
range-set: satisfy non-empty ranges invariant
t4211: demonstrate crash when first -L encountered is empty range
t4211: demonstrate empty -L range crash
range-set: fix sort_and_merge_range_set() corner case bug
Diffstat (limited to 't/t4211-line-log.sh')
-rwxr-xr-x | t/t4211-line-log.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t4211-line-log.sh b/t/t4211-line-log.sh index 7776f93e3d..7665d6785c 100755 --- a/t/t4211-line-log.sh +++ b/t/t4211-line-log.sh @@ -64,4 +64,17 @@ test_bad_opts "-L 1,1000:b.c" "has only.*lines" test_bad_opts "-L :b.c" "argument.*not of the form" test_bad_opts "-L :foo:b.c" "no match" +# There is a separate bug when an empty -L range is the first -L encountered, +# thus to demonstrate this particular bug, the empty -L range must follow a +# non-empty -L range. +test_expect_success '-L {empty-range} (any -L)' ' + n=$(expr $(wc -l <b.c) + 1) && + git log -L1,1:b.c -L$n:b.c +' + +test_expect_success '-L {empty-range} (first -L)' ' + n=$(expr $(wc -l <b.c) + 1) && + git log -L$n:b.c +' + test_done |