]> git.ipfire.org Git - thirdparty/git.git/blob - t/t9139-git-svn-non-utf8-commitencoding.sh
Merge branch 'ro/mktree-allow-missing-fix' into maint
[thirdparty/git.git] / t / t9139-git-svn-non-utf8-commitencoding.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2009 Eric Wong
4
5 test_description='git svn refuses to dcommit non-UTF8 messages'
6
7 TEST_FAILS_SANITIZE_LEAK=true
8 . ./lib-git-svn.sh
9
10 # ISO-2022-JP can pass for valid UTF-8, so skipping that in this test
11
12 for H in ISO8859-1 eucJP
13 do
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
18 '
19 done
20
21 for H in ISO8859-1 eucJP
22 do
23 test_expect_success "$H commit on git side" '
24 (
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"
33 )
34 '
35 done
36
37 for H in ISO8859-1 eucJP
38 do
39 test_expect_success "$H dcommit to svn" '
40 (
41 cd $H &&
42 git config --unset i18n.commitencoding &&
43 test_must_fail git svn dcommit
44 )
45 '
46 done
47
48 test_done