Skip to content

Commit 9527604

Browse files
sunshinecogitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 215e76c commit 9527604

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/annotate-tests.sh

+12
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,18 @@ test_expect_success 'blame -L Y,X (undocumented)' '
185185
check_count -L6,3 B 1 B1 1 B2 1 D 1
186186
'
187187

188+
test_expect_failure 'blame -L -X' '
189+
test_must_fail $PROG -L-1 file
190+
'
191+
192+
test_expect_failure 'blame -L 0' '
193+
test_must_fail $PROG -L0 file
194+
'
195+
196+
test_expect_failure 'blame -L ,0' '
197+
test_must_fail $PROG -L,0 file
198+
'
199+
188200
test_expect_success 'blame -L ,+0' '
189201
test_must_fail $PROG -L,+0 file
190202
'

0 commit comments

Comments
 (0)