3 test_description
='git-annotate'
7 'prepare reference tree' \
8 'echo "1A quick brown fox jumps over the" >file &&
9 echo "lazy dog" >>file &&
11 GIT_AUTHOR_NAME="A" git commit -a -m "Initial."'
14 'check all lines blamed on A' \
15 '[ $(git annotate file | awk "{print \$3}" | grep -c "A") == 2 ]'
18 'Setup new lines blamed on B' \
19 'echo "2A quick brown fox jumps over the" >>file &&
20 echo "lazy dog" >> file &&
21 GIT_AUTHOR_NAME="B" git commit -a -m "Second."'
24 'Two lines blamed on A' \
25 '[ $(git annotate file | awk "{print \$3}" | grep -c "A") == 2 ]'
28 'Two lines blamed on B' \
29 '[ $(git annotate file | awk "{print \$3}" | grep -c "B") == 2 ]'
32 'merge-setup part 1' \
33 'git checkout -b branch1 master &&
34 echo "3A slow green fox jumps into the" >> file &&
35 echo "well." >> file &&
36 GIT_AUTHOR_NAME="B1" git commit -a -m "Branch1-1"'
39 'Two lines blamed on A' \
40 '[ $(git annotate file | awk "{print \$3}" | grep -c "^A$") == 2 ]'
43 'Two lines blamed on B' \
44 '[ $(git annotate file | awk "{print \$3}" | grep -c "^B$") == 2 ]'
47 'Two lines blamed on B1' \
48 '[ $(git annotate file | awk "{print \$3}" | grep -c "^B1$") == 2 ]'
51 'merge-setup part 2' \
52 'git checkout -b branch2 master &&
53 sed -i -e "s/2A quick brown/4A quick brown lazy dog/" file &&
54 GIT_AUTHOR_NAME="B2" git commit -a -m "Branch2-1"'
57 'Two lines blamed on A' \
58 '[ $(git annotate file | awk "{print \$3}" | grep -c "^A$") == 2 ]'
61 'One line blamed on B' \
62 '[ $(git annotate file | awk "{print \$3}" | grep -c "^B$") == 1 ]'
65 'One line blamed on B2' \
66 '[ $(git annotate file | awk "{print \$3}" | grep -c "^B2$") == 1 ]'
70 'merge-setup part 3' \
74 'Two lines blamed on A' \
75 '[ $(git annotate file | awk "{print \$3}" | grep -c "^A$") == 2 ]'
78 'One line blamed on B' \
79 '[ $(git annotate file | awk "{print \$3}" | grep -c "^B$") == 1 ]'
82 'Two lines blamed on B1' \
83 '[ $(git annotate file | awk "{print \$3}" | grep -c "^B1$") == 2 ]'
86 'One line blamed on B2' \
87 '[ $(git annotate file | awk "{print \$3}" | grep -c "^B2$") == 1 ]'