2009-05-28 11:56:23 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2009 Eric Wong
|
|
|
|
|
|
|
|
test_description='git svn refuses to dcommit non-UTF8 messages'
|
|
|
|
|
|
|
|
. ./lib-git-svn.sh
|
|
|
|
|
|
|
|
# ISO-2022-JP can pass for valid UTF-8, so skipping that in this test
|
|
|
|
|
2009-05-30 04:14:47 +04:00
|
|
|
for H in ISO8859-1 eucJP
|
2009-05-28 11:56:23 +04:00
|
|
|
do
|
|
|
|
test_expect_success "$H setup" '
|
|
|
|
mkdir $H &&
|
|
|
|
svn_cmd import -m "$H test" $H "$svnrepo"/$H &&
|
|
|
|
git svn clone "$svnrepo"/$H $H
|
|
|
|
'
|
|
|
|
done
|
|
|
|
|
2009-05-30 04:14:47 +04:00
|
|
|
for H in ISO8859-1 eucJP
|
2009-05-28 11:56:23 +04:00
|
|
|
do
|
|
|
|
test_expect_success "$H commit on git side" '
|
|
|
|
(
|
|
|
|
cd $H &&
|
|
|
|
git config i18n.commitencoding $H &&
|
|
|
|
git checkout -b t refs/remotes/git-svn &&
|
|
|
|
echo $H >F &&
|
|
|
|
git add F &&
|
|
|
|
git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
|
|
|
|
E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
|
|
|
|
test "z$E" = "z$H"
|
|
|
|
)
|
|
|
|
'
|
|
|
|
done
|
|
|
|
|
2009-05-30 04:14:47 +04:00
|
|
|
for H in ISO8859-1 eucJP
|
2009-05-28 11:56:23 +04:00
|
|
|
do
|
|
|
|
test_expect_success "$H dcommit to svn" '
|
|
|
|
(
|
|
|
|
cd $H &&
|
|
|
|
git config --unset i18n.commitencoding &&
|
2010-07-21 03:18:34 +04:00
|
|
|
test_must_fail git svn dcommit
|
2009-05-28 11:56:23 +04:00
|
|
|
)
|
|
|
|
'
|
|
|
|
done
|
|
|
|
|
|
|
|
test_done
|