Merge branch 'master' of github.com:alshopov/git-po
[alt-git.git] / t / t9139-git-svn-non-utf8-commitencoding.sh
blobb7f756b2b7f28f6e5d32fa595ebbf1ca2bebb45b
1 #!/bin/sh
3 # Copyright (c) 2009 Eric Wong
5 test_description='git svn refuses to dcommit non-UTF8 messages'
7 TEST_FAILS_SANITIZE_LEAK=true
8 . ./lib-git-svn.sh
10 # ISO-2022-JP can pass for valid UTF-8, so skipping that in this test
12 for H in ISO8859-1 eucJP
14 test_expect_success "$H setup" '
15 mkdir $H &&
16 svn_cmd import -m "$H test" $H "$svnrepo"/$H &&
17 git svn clone "$svnrepo"/$H $H
19 done
21 for H in ISO8859-1 eucJP
23 test_expect_success "$H commit on git side" '
25 cd $H &&
26 git config i18n.commitencoding $H &&
27 git checkout -b t refs/remotes/git-svn &&
28 echo $H >F &&
29 git add F &&
30 git commit -a -F "$TEST_DIRECTORY"/t3900/$H.txt &&
31 E=$(git cat-file commit HEAD | sed -ne "s/^encoding //p") &&
32 test "z$E" = "z$H"
35 done
37 for H in ISO8859-1 eucJP
39 test_expect_success "$H dcommit to svn" '
41 cd $H &&
42 git config --unset i18n.commitencoding &&
43 test_must_fail git svn dcommit
46 done
48 test_done