Skip to content

Commit cda3935

Browse files
newrengitster
authored andcommitted
t9350: fix encoding test to actually test reencoding
This test used an author with non-ascii characters in the name, but no special commit message. It then grep'ed for those non-ascii characters, but those are guaranteed to exist regardless of the reencoding process since the reencoding only affects the commit message, not the author or committer names. As such, the test would work even if the re-encoding process simply stripped the commit message entirely. Modify the test to actually check that the reencoding in utf-8 worked. Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 83232e3 commit cda3935

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

t/t9350-fast-export.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,21 @@ test_expect_success 'fast-export --show-original-ids | git fast-import' '
9494
test $MUSS = $(git rev-parse --verify refs/tags/muss)
9595
'
9696

97-
test_expect_success 'iso-8859-1' '
97+
test_expect_success 'iso-8859-7' '
9898
99-
git config i18n.commitencoding ISO8859-1 &&
100-
# use author and committer name in ISO-8859-1 to match it.
101-
. "$TEST_DIRECTORY"/t3901/8859-1.txt &&
99+
test_when_finished "git reset --hard HEAD~1" &&
100+
test_config i18n.commitencoding iso-8859-7 &&
102101
test_tick &&
103102
echo rosten >file &&
104-
git commit -s -m den file &&
105-
git fast-export wer^..wer >iso8859-1.fi &&
106-
sed "s/wer/i18n/" iso8859-1.fi |
103+
git commit -s -m "$(printf "Pi: \360")" file &&
104+
git fast-export wer^..wer >iso-8859-7.fi &&
105+
sed "s/wer/i18n/" iso-8859-7.fi |
107106
(cd new &&
108107
git fast-import &&
109108
git cat-file commit i18n >actual &&
110-
grep "Áéí óú" actual)
111-
109+
grep $(printf "\317\200") actual)
112110
'
111+
113112
test_expect_success 'import/export-marks' '
114113
115114
git checkout -b marks master &&
@@ -224,7 +223,6 @@ GIT_COMMITTER_NAME='C O Mitter'; export GIT_COMMITTER_NAME
224223

225224
test_expect_success 'setup copies' '
226225
227-
git config --unset i18n.commitencoding &&
228226
git checkout -b copy rein &&
229227
git mv file file3 &&
230228
git commit -m move1 &&

0 commit comments

Comments
 (0)