3 test_description
='git blame'
7 .
"$TEST_DIRECTORY"/annotate-tests.sh
10 test_expect_success
'blame --show-email' '
16 "<author@example.com>" 1 \
19 "<E at test dot git>" 1
22 test_expect_success
'setup showEmail tests' '
23 echo "bin: test number 1" >one &&
25 GIT_AUTHOR_NAME=name1 \
26 GIT_AUTHOR_EMAIL=email1@test.git \
27 git commit -m First --date="2010-01-01 01:00:00" &&
28 cat >expected_n <<-\EOF &&
29 (name1 2010-01-01 01:00:00 +0000 1) bin: test number 1
31 cat >expected_e <<-\EOF
32 (<email1@test.git> 2010-01-01 01:00:00 +0000 1) bin: test number 1
40 test_expect_success
'blame with no options and no config' '
41 git blame one >blame &&
42 find_blame <blame >result &&
43 test_cmp expected_n result
46 test_expect_success
'blame with showemail options' '
47 git blame --show-email one >blame1 &&
48 find_blame <blame1 >result &&
49 test_cmp expected_e result &&
50 git blame -e one >blame2 &&
51 find_blame <blame2 >result &&
52 test_cmp expected_e result &&
53 git blame --no-show-email one >blame3 &&
54 find_blame <blame3 >result &&
55 test_cmp expected_n result
58 test_expect_success
'blame with showEmail config false' '
59 git config blame.showEmail false &&
60 git blame one >blame1 &&
61 find_blame <blame1 >result &&
62 test_cmp expected_n result &&
63 git blame --show-email one >blame2 &&
64 find_blame <blame2 >result &&
65 test_cmp expected_e result &&
66 git blame -e one >blame3 &&
67 find_blame <blame3 >result &&
68 test_cmp expected_e result &&
69 git blame --no-show-email one >blame4 &&
70 find_blame <blame4 >result &&
71 test_cmp expected_n result
74 test_expect_success
'blame with showEmail config true' '
75 git config blame.showEmail true &&
76 git blame one >blame1 &&
77 find_blame <blame1 >result &&
78 test_cmp expected_e result &&
79 git blame --no-show-email one >blame2 &&
80 find_blame <blame2 >result &&
81 test_cmp expected_n result