]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9139-git-svn-non-utf8-commitencoding.sh
Sync with Git 2.45.1
[thirdparty/git.git] / t / t9139-git-svn-non-utf8-commitencoding.sh
CommitLineData
b510df8a
EW
1#!/bin/sh
2#
3# Copyright (c) 2009 Eric Wong
4
5test_description='git svn refuses to dcommit non-UTF8 messages'
6
7a98d9ab 7TEST_FAILS_SANITIZE_LEAK=true
b510df8a
EW
8. ./lib-git-svn.sh
9
10# ISO-2022-JP can pass for valid UTF-8, so skipping that in this test
11
18864314 12for H in ISO8859-1 eucJP
b510df8a
EW
13do
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 '
19done
20
18864314 21for H in ISO8859-1 eucJP
b510df8a
EW
22do
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 '
35done
36
18864314 37for H in ISO8859-1 eucJP
b510df8a
EW
38do
39 test_expect_success "$H dcommit to svn" '
40 (
41 cd $H &&
42 git config --unset i18n.commitencoding &&
ce14e0b2 43 test_must_fail git svn dcommit
b510df8a
EW
44 )
45 '
46done
47
48test_done