Raw
1 #!/bin/sh
2
3 test_description='git annotate'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 TEST_CREATE_REPO_NO_TEMPLATE=1
8 . ./test-lib.sh
9
10 if ! test_have_prereq PERL_TEST_HELPERS
11 then
12 skip_all='skipping annotate tests; Perl not available'
13 test_done
14 fi
15
16 PROG='git annotate'
17 . "$TEST_DIRECTORY"/annotate-tests.sh
18
19 test_expect_success 'annotate old revision' '
20 git annotate file main >actual &&
21 awk "{ print \$3; }" <actual >authors &&
22 test 2 = $(grep A <authors | wc -l) &&
23 test 2 = $(grep B <authors | wc -l)
24 '
25
26 test_done