1 # This file isn't used as a test script directly, instead it is
2 # sourced from t8001-annotate.sh and t8001-blame.sh.
5 'prepare reference tree' \
6 'echo "1A quick brown fox jumps over the" >file &&
7 echo "lazy dog" >>file &&
9 GIT_AUTHOR_NAME="A" git commit -a -m "Initial."'
12 'check all lines blamed on A' \
13 '[ $(git annotate file | awk "{print \$3}" | grep -c "A") == 2 ]'
16 'Setup new lines blamed on B' \
17 'echo "2A quick brown fox jumps over the" >>file &&
18 echo "lazy dog" >> file &&
19 GIT_AUTHOR_NAME="B" git commit -a -m "Second."'
22 'Two lines blamed on A' \
23 '[ $($PROG file | awk "{print \$3}" | grep -c "A") == 2 ]'
26 'Two lines blamed on B' \
27 '[ $($PROG file | awk "{print \$3}" | grep -c "B") == 2 ]'
30 'merge-setup part 1' \
31 'git checkout -b branch1 master &&
32 echo "3A slow green fox jumps into the" >> file &&
33 echo "well." >> file &&
34 GIT_AUTHOR_NAME="B1" git commit -a -m "Branch1-1"'
37 'Two lines blamed on A' \
38 '[ $($PROG file | awk "{print \$3}" | grep -c "^A$") == 2 ]'
41 'Two lines blamed on B' \
42 '[ $($PROG file | awk "{print \$3}" | grep -c "^B$") == 2 ]'
45 'Two lines blamed on B1' \
46 '[ $($PROG file | awk "{print \$3}" | grep -c "^B1$") == 2 ]'
49 'merge-setup part 2' \
50 'git checkout -b branch2 master &&
51 sed -e "s/2A quick brown/4A quick brown lazy dog/" < file > file.new &&
53 GIT_AUTHOR_NAME="B2" git commit -a -m "Branch2-1"'
56 'Two lines blamed on A' \
57 '[ $($PROG file | awk "{print \$3}" | grep -c "^A$") == 2 ]'
60 'One line blamed on B' \
61 '[ $($PROG file | awk "{print \$3}" | grep -c "^B$") == 1 ]'
64 'One line blamed on B2' \
65 '[ $($PROG file | awk "{print \$3}" | grep -c "^B2$") == 1 ]'
69 'merge-setup part 3' \
73 'Two lines blamed on A' \
74 '[ $($PROG file | awk "{print \$3}" | grep -c "^A$") == 2 ]'
77 'One line blamed on B' \
78 '[ $($PROG file | awk "{print \$3}" | grep -c "^B$") == 1 ]'
81 'Two lines blamed on B1' \
82 '[ $($PROG file | awk "{print \$3}" | grep -c "^B1$") == 2 ]'
85 'One line blamed on B2' \
86 '[ $($PROG file | awk "{print \$3}" | grep -c "^B2$") == 1 ]'