Skip to content

Commit 5ae93df

Browse files
drafnelgitster
authored andcommitted
t3900: use ancient iconv names for backward compatibility
Some old iconv implementations do not have many alternate names and/or do not match character encoding names case insensitively. These implementations can not tell that utf-8 and UTF-8 are the same encoding and fail when trying to do the conversion. So use the old names, which modern implementations still support. The following conversions were performed: utf-8 --> UTF-8 ISO-8859-1 --> ISO8859-1 EUCJP --> eucJP Also update t9129 and t9500 which make use of the test files in t/t3900. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 99ddd24 commit 5ae93df

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

t/t3900-i18n-commit.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ test_expect_success 'no encoding header for base case' '
3434
test z = "z$E"
3535
'
3636

37-
for H in ISO-8859-1 EUCJP ISO-2022-JP
37+
for H in ISO8859-1 eucJP ISO-2022-JP
3838
do
3939
test_expect_success "$H setup" '
4040
git config i18n.commitencoding $H &&
@@ -44,7 +44,7 @@ do
4444
'
4545
done
4646

47-
for H in ISO-8859-1 EUCJP ISO-2022-JP
47+
for H in ISO8859-1 eucJP ISO-2022-JP
4848
do
4949
test_expect_success "check encoding header for $H" '
5050
E=$(git cat-file commit '$H' | sed -ne "s/^encoding //p") &&
@@ -61,14 +61,14 @@ test_expect_success 'config to remove customization' '
6161
else
6262
test z = "z$Z"
6363
fi &&
64-
git config i18n.commitencoding utf-8
64+
git config i18n.commitencoding UTF-8
6565
'
6666

67-
test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' '
68-
compare_with ISO-8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
67+
test_expect_success 'ISO8859-1 should be shown in UTF-8 now' '
68+
compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
6969
'
7070

71-
for H in EUCJP ISO-2022-JP
71+
for H in eucJP ISO-2022-JP
7272
do
7373
test_expect_success "$H should be shown in UTF-8 now" '
7474
compare_with '$H' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
@@ -86,7 +86,7 @@ test_expect_success 'config to add customization' '
8686
fi
8787
'
8888

89-
for H in ISO-8859-1 EUCJP ISO-2022-JP
89+
for H in ISO8859-1 eucJP ISO-2022-JP
9090
do
9191
test_expect_success "$H should be shown in itself now" '
9292
git config i18n.commitencoding '$H' &&
@@ -95,21 +95,21 @@ do
9595
done
9696

9797
test_expect_success 'config to tweak customization' '
98-
git config i18n.logoutputencoding utf-8
98+
git config i18n.logoutputencoding UTF-8
9999
'
100100

101-
test_expect_success 'ISO-8859-1 should be shown in UTF-8 now' '
102-
compare_with ISO-8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
101+
test_expect_success 'ISO8859-1 should be shown in UTF-8 now' '
102+
compare_with ISO8859-1 "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
103103
'
104104

105-
for H in EUCJP ISO-2022-JP
105+
for H in eucJP ISO-2022-JP
106106
do
107107
test_expect_success "$H should be shown in UTF-8 now" '
108108
compare_with '$H' "$TEST_DIRECTORY"/t3900/2-UTF-8.txt
109109
'
110110
done
111111

112-
for J in EUCJP ISO-2022-JP
112+
for J in eucJP ISO-2022-JP
113113
do
114114
if test "$J" = ISO-2022-JP
115115
then
@@ -118,15 +118,15 @@ do
118118
ICONV=
119119
fi
120120
git config i18n.logoutputencoding $J
121-
for H in EUCJP ISO-2022-JP
121+
for H in eucJP ISO-2022-JP
122122
do
123123
test_expect_success "$H should be shown in $J now" '
124124
compare_with '$H' "$TEST_DIRECTORY"/t3900/'$J'.txt $ICONV
125125
'
126126
done
127127
done
128128

129-
for H in ISO-8859-1 EUCJP ISO-2022-JP
129+
for H in ISO8859-1 eucJP ISO-2022-JP
130130
do
131131
test_expect_success "No conversion with $H" '
132132
compare_with "--encoding=none '$H'" "$TEST_DIRECTORY"/t3900/'$H'.txt
File renamed without changes.

t/t9129-git-svn-i18n-commitencoding.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ compare_svn_head_with () {
2929
test_cmp current "$1"
3030
}
3131

32-
for H in ISO-8859-1 EUCJP ISO-2022-JP
32+
for H in ISO8859-1 eucJP ISO-2022-JP
3333
do
3434
test_expect_success "$H setup" '
3535
mkdir $H &&
@@ -38,7 +38,7 @@ do
3838
'
3939
done
4040

41-
for H in ISO-8859-1 EUCJP ISO-2022-JP
41+
for H in ISO8859-1 eucJP ISO-2022-JP
4242
do
4343
test_expect_success "$H commit on git side" '
4444
(
@@ -55,7 +55,7 @@ do
5555
'
5656
done
5757

58-
for H in ISO-8859-1 EUCJP ISO-2022-JP
58+
for H in ISO8859-1 eucJP ISO-2022-JP
5959
do
6060
test_expect_success "$H dcommit to svn" '
6161
(
@@ -77,12 +77,12 @@ fi
7777

7878
test_expect_success UTF8 'ISO-8859-1 should match UTF-8 in svn' '
7979
(
80-
cd ISO-8859-1 &&
80+
cd ISO8859-1 &&
8181
compare_svn_head_with "$TEST_DIRECTORY"/t3900/1-UTF-8.txt
8282
)
8383
'
8484

85-
for H in EUCJP ISO-2022-JP
85+
for H in eucJP ISO-2022-JP
8686
do
8787
test_expect_success UTF8 "$H should match UTF-8 in svn" '
8888
(

t/t9500-gitweb-standalone-no-errors.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ test_expect_success \
590590
echo "ISO-8859-1" >> file &&
591591
git add file &&
592592
git config i18n.commitencoding ISO-8859-1 &&
593-
git commit -F "$TEST_DIRECTORY"/t3900/ISO-8859-1.txt &&
593+
git commit -F "$TEST_DIRECTORY"/t3900/ISO8859-1.txt &&
594594
git config --unset i18n.commitencoding &&
595595
gitweb_run "p=.git;a=commit"'
596596
test_debug 'cat gitweb.log'

0 commit comments

Comments
 (0)