]>
git.ipfire.org Git - thirdparty/git.git/blob - t/t8005-blame-i18n.sh
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"
36 filter_author_summary
() {
37 sed -n -e '/^author /p' -e '/^summary /p' "$@"
40 test_expect_success
!MINGW \
41 'blame respects i18n.commitencoding' '
42 git blame --incremental file >output &&
43 filter_author_summary output >actual &&
44 test_cmp expected actual
48 author $EUC_JAPAN_NAME
49 summary $EUC_JAPAN_MSG
50 author $EUC_JAPAN_NAME
51 summary $EUC_JAPAN_MSG
52 author $EUC_JAPAN_NAME
53 summary $EUC_JAPAN_MSG
56 test_expect_success
!MINGW \
57 'blame respects i18n.logoutputencoding' '
58 git config i18n.logoutputencoding eucJP &&
59 git blame --incremental file >output &&
60 filter_author_summary output >actual &&
61 test_cmp expected actual
73 test_expect_success
!MINGW \
74 'blame respects --encoding=UTF-8' '
75 git blame --incremental --encoding=UTF-8 file >output &&
76 filter_author_summary output >actual &&
77 test_cmp expected actual
83 author $EUC_JAPAN_NAME
84 summary $EUC_JAPAN_MSG
89 test_expect_success
!MINGW \
90 'blame respects --encoding=none' '
91 git blame --incremental --encoding=none file >output &&
92 filter_author_summary output >actual &&
93 test_cmp expected actual