diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-05-30 22:25:41 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-05-30 22:25:41 -0700 |
commit | 0ddbbb66614c7a503442ff863817ccbc68f417ab (patch) | |
tree | da00a95aee5901fe64649e87d2aad5eca2d75db3 /t/t9139-git-svn-non-utf8-commitencoding.sh | |
parent | d183663785c0d78f73b31ad43fa57b0742d2a95c (diff) | |
parent | b510df8af2c86d441de87fa4be09f786b5411527 (diff) | |
download | git-0ddbbb66614c7a503442ff863817ccbc68f417ab.tar.gz |
Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn:
git-svn: refuse to dcommit non-UTF-8 messages
Diffstat (limited to 't/t9139-git-svn-non-utf8-commitencoding.sh')
-rwxr-xr-x | t/t9139-git-svn-non-utf8-commitencoding.sh | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/t/t9139-git-svn-non-utf8-commitencoding.sh b/t/t9139-git-svn-non-utf8-commitencoding.sh new file mode 100755 index 0000000000..2b1db97337 --- /dev/null +++ b/t/t9139-git-svn-non-utf8-commitencoding.sh @@ -0,0 +1,47 @@ +#!/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 + +for H in ISO-8859-1 EUCJP +do + test_expect_success "$H setup" ' + mkdir $H && + svn_cmd import -m "$H test" $H "$svnrepo"/$H && + git svn clone "$svnrepo"/$H $H + ' +done + +for H in ISO-8859-1 EUCJP +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 + +for H in ISO-8859-1 EUCJP +do + test_expect_success "$H dcommit to svn" ' + ( + cd $H && + git config --unset i18n.commitencoding && + ! git svn dcommit + ) + ' +done + +test_done |