#!/bin/sh # # Copyright (c) 2009 Eric Wong global test_description := ''git svn refuses to dcommit non-UTF8 messages'' source ./lib-git-svn.sh # ISO-2022-JP can pass for valid UTF-8, so skipping that in this test for H in [ISO8859-1 eucJP] { test_expect_success "$H setup" ' mkdir $H && svn_cmd import -m "$H test" $H "$svnrepo"/$H && git svn clone "$svnrepo"/$H $H ' } for H in [ISO8859-1 eucJP] { 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" ) ' } for H in [ISO8859-1 eucJP] { test_expect_success "$H dcommit to svn" ' ( cd $H && git config --unset i18n.commitencoding && test_must_fail git svn dcommit ) ' } test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"git svn refuses to dcommit non-UTF8 messages">)} spids: [10] ) ] spids: [10] ) (C {(.)} {(./lib-git-svn.sh)}) (ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)}] do_arg_iter: False body: (DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_Name "$H") (" setup"))} { (SQ <"\n"> <"\t\tmkdir $H &&\n"> <"\t\tsvn_cmd import -m \"$H test\" $H \"$svnrepo\"/$H &&\n"> <"\t\tgit svn clone \"$svnrepo\"/$H $H\n"> <"\t"> ) } ) ] spids: [35 53] ) spids: [30 -1] ) (ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)}] do_arg_iter: False body: (DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_Name "$H") (" commit on git side"))} { (SQ <"\n"> <"\t(\n"> <"\t\tcd $H &&\n"> <"\t\tgit config i18n.commitencoding $H &&\n"> <"\t\tgit checkout -b t refs/remotes/git-svn &&\n"> <"\t\techo $H >F &&\n"> <"\t\tgit add F &&\n"> <"\t\tgit commit -a -F \"$TEST_DIRECTORY\"/t3900/$H.txt &&\n"> <"\t\tE=$(git cat-file commit HEAD | sed -ne \"s/^encoding //p\") &&\n"> <"\t\ttest \"z$E\" = \"z$H\"\n"> <"\t)\n"> <"\t"> ) } ) ] spids: [66 91] ) spids: [61 -1] ) (ForEach iter_name: H iter_words: [{(ISO8859-1)} {(eucJP)}] do_arg_iter: False body: (DoGroup children: [ (C {(test_expect_success)} {(DQ ($ VSub_Name "$H") (" dcommit to svn"))} { (SQ <"\n"> <"\t(\n"> <"\t\tcd $H &&\n"> <"\t\tgit config --unset i18n.commitencoding &&\n"> <"\t\ttest_must_fail git svn dcommit\n"> <"\t)\n"> <"\t"> ) } ) ] spids: [104 124] ) spids: [99 -1] ) (C {(test_done)}) ] )