line-range: teach -L^:RE to search from start of file
The -L:RE option of blame/log searches from the end of the previous -L range, if any. Add new notation -L^:RE to override this behavior and search from start of file. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1ce761a524
commit
215e76c7ff
@ -398,6 +398,23 @@ test_expect_success 'blame -L :RE (relative: end-of-file)' '
|
||||
test_must_fail $PROG -L, -L:main hello.c
|
||||
'
|
||||
|
||||
test_expect_success 'blame -L ^:RE (absolute)' '
|
||||
check_count -f hello.c -L3,3 -L^:ma.. F 4 G 1
|
||||
'
|
||||
|
||||
test_expect_success 'blame -L ^:RE (absolute: no preceding range)' '
|
||||
check_count -f hello.c -L^:ma.. F 4 G 1
|
||||
'
|
||||
|
||||
test_expect_success 'blame -L ^:RE (absolute: not found)' '
|
||||
test_must_fail $PROG -L4,4 -L^:tambourine hello.c
|
||||
'
|
||||
|
||||
test_expect_success 'blame -L ^:RE (absolute: end-of-file)' '
|
||||
n=$(printf "%d" $(wc -l <hello.c)) &&
|
||||
check_count -f hello.c -L$n -L^:ma.. F 4 G 1 H 1
|
||||
'
|
||||
|
||||
test_expect_success 'setup incremental' '
|
||||
(
|
||||
GIT_AUTHOR_NAME=I &&
|
||||
|
||||
Reference in New Issue
Block a user