aboutsummaryrefslogtreecommitdiff
path: root/t/annotate-tests.sh
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2013-08-06 09:59:47 -0400
committerJunio C Hamano <gitster@pobox.com>2013-08-06 14:48:02 -0700
commit215e76c7ff8be46b8206c45aed3b6ec29069d4fc (patch)
treef832aea7509f86446d5a123e6c4748d937a2e21f /t/annotate-tests.sh
parent1ce761a524e34f2d629759cb57c67d13acbe4a7a (diff)
downloadgit-215e76c7ff8be46b8206c45aed3b6ec29069d4fc.tar.gz
git-215e76c7ff8be46b8206c45aed3b6ec29069d4fc.tar.xz
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>
Diffstat (limited to 't/annotate-tests.sh')
-rw-r--r--t/annotate-tests.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/t/annotate-tests.sh b/t/annotate-tests.sh
index 4f7d6baef..dabe89d91 100644
--- a/t/annotate-tests.sh
+++ b/t/annotate-tests.sh
@@ -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 &&