3 test_description='git blame encoding conversion'
6 . "$TEST_DIRECTORY"/t8005/utf8.txt
7 . "$TEST_DIRECTORY"/t8005/euc-japan.txt
8 . "$TEST_DIRECTORY"/t8005/sjis.txt
10 test_expect_success 'setup the repository' '
12 echo "UTF-8 LINE" > file &&
14 git commit --author "$UTF8_NAME <utf8@localhost>" -m "$UTF8_MSG" &&
16 echo "EUC-JAPAN LINE" >> file &&
18 git config i18n.commitencoding eucJP &&
19 git commit --author "$EUC_JAPAN_NAME <euc-japan@localhost>" -m "$EUC_JAPAN_MSG" &&
21 echo "SJIS LINE" >> file &&
23 git config i18n.commitencoding SJIS &&
24 git commit --author "$SJIS_NAME <sjis@localhost>" -m "$SJIS_MSG"
37 'blame respects i18n.commitencoding' '
38 git blame --incremental file | \
39 egrep "^(author|summary) " > actual &&
40 test_cmp actual expected
44 author $EUC_JAPAN_NAME
45 summary $EUC_JAPAN_MSG
46 author $EUC_JAPAN_NAME
47 summary $EUC_JAPAN_MSG
48 author $EUC_JAPAN_NAME
49 summary $EUC_JAPAN_MSG
53 'blame respects i18n.logoutputencoding' '
54 git config i18n.logoutputencoding eucJP &&
55 git blame --incremental file | \
56 egrep "^(author|summary) " > actual &&
57 test_cmp actual expected
70 'blame respects --encoding=UTF-8' '
71 git blame --incremental --encoding=UTF-8 file | \
72 egrep "^(author|summary) " > actual &&
73 test_cmp actual expected
79 author $EUC_JAPAN_NAME
80 summary $EUC_JAPAN_MSG
86 'blame respects --encoding=none' '
87 git blame --incremental --encoding=none file | \
88 egrep "^(author|summary) " > actual &&
89 test_cmp actual expected