3 test_description
='git blame encoding conversion'
6 if ! test_have_prereq ICONV
; then
7 skip_all
='skipping i18n tests, iconv not available'
11 .
"$TEST_DIRECTORY"/t8005
/utf8.txt
12 .
"$TEST_DIRECTORY"/t8005
/euc-japan.txt
13 .
"$TEST_DIRECTORY"/t8005
/sjis.txt
15 test_expect_success
'setup the repository' '
17 echo "UTF-8 LINE" > file &&
19 git commit --author "$UTF8_NAME <utf8@localhost>" -m "$UTF8_MSG" &&
21 echo "EUC-JAPAN LINE" >> file &&
23 git config i18n.commitencoding eucJP &&
24 git commit --author "$EUC_JAPAN_NAME <euc-japan@localhost>" -m "$EUC_JAPAN_MSG" &&
26 echo "SJIS LINE" >> file &&
28 git config i18n.commitencoding SJIS &&
29 git commit --author "$SJIS_NAME <sjis@localhost>" -m "$SJIS_MSG"
41 test_expect_success
!MINGW \
42 'blame respects i18n.commitencoding' '
43 git blame --incremental file | \
44 egrep "^(author|summary) " > actual &&
45 test_cmp actual expected
49 author $EUC_JAPAN_NAME
50 summary $EUC_JAPAN_MSG
51 author $EUC_JAPAN_NAME
52 summary $EUC_JAPAN_MSG
53 author $EUC_JAPAN_NAME
54 summary $EUC_JAPAN_MSG
57 test_expect_success
!MINGW \
58 'blame respects i18n.logoutputencoding' '
59 git config i18n.logoutputencoding eucJP &&
60 git blame --incremental file | \
61 egrep "^(author|summary) " > actual &&
62 test_cmp actual expected
74 test_expect_success
!MINGW \
75 'blame respects --encoding=UTF-8' '
76 git blame --incremental --encoding=UTF-8 file | \
77 egrep "^(author|summary) " > actual &&
78 test_cmp actual expected
84 author $EUC_JAPAN_NAME
85 summary $EUC_JAPAN_MSG
90 test_expect_success
!MINGW \
91 'blame respects --encoding=none' '
92 git blame --incremental --encoding=none file | \
93 egrep "^(author|summary) " > actual &&
94 test_cmp actual expected