Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
t8001/t8002: blame: add tests of -L line numbers less than 1
git-blame -L is documented as accepting 1-based line numbers. When
handed a line number less than 1, -L's behavior is undocumented and
undefined; it's also nonsensical and should be rejected but is
nevertheless accepted. Demonstrate this shortcoming.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Eric Sunshine authored and Junio C Hamano committed Aug 6, 2013
1 parent 215e76c commit 9527604
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/annotate-tests.sh
Expand Up @@ -185,6 +185,18 @@ test_expect_success 'blame -L Y,X (undocumented)' '
check_count -L6,3 B 1 B1 1 B2 1 D 1
'

test_expect_failure 'blame -L -X' '
test_must_fail $PROG -L-1 file
'

test_expect_failure 'blame -L 0' '
test_must_fail $PROG -L0 file
'

test_expect_failure 'blame -L ,0' '
test_must_fail $PROG -L,0 file
'

test_expect_success 'blame -L ,+0' '
test_must_fail $PROG -L,+0 file
'
Expand Down

0 comments on commit 9527604

Please sign in to comment.