git-svn: add UTF-8 message test
[git.git] / contrib / git-svn / t / t0000-contrib-git-svn.sh
index 8b3a0d9..0c6ff20 100644 (file)
@@ -4,6 +4,7 @@
 #
 
 test_description='git-svn tests'
+GIT_SVN_LC_ALL=$LC_ALL
 . ./lib-git-svn.sh
 
 mkdir import
@@ -32,7 +33,7 @@ test_expect_success \
 
 
 name='try a deep --rmdir with a commit'
-git checkout -b mybranch remotes/git-svn
+git checkout -f -b mybranch remotes/git-svn
 mv dir/a/b/c/d/e/file dir/file
 cp dir/file file
 git update-index --add --remove dir/a/b/c/d/e/file dir/file file
@@ -58,7 +59,7 @@ test_expect_code 1 "$name" \
 
 name='detect node change from directory to file #1'
 rm -rf dir $GIT_DIR/index
-git checkout -b mybranch2 remotes/git-svn
+git checkout -f -b mybranch2 remotes/git-svn
 mv bar/zzz zzz
 rm -rf bar
 mv zzz bar
@@ -73,7 +74,7 @@ test_expect_code 1 "$name" \
 
 name='detect node change from file to directory #2'
 rm -f $GIT_DIR/index
-git checkout -b mybranch3 remotes/git-svn
+git checkout -f -b mybranch3 remotes/git-svn
 rm bar/zzz
 git-update-index --remove bar/zzz
 mkdir bar/zzz
@@ -88,7 +89,7 @@ test_expect_code 1 "$name" \
 
 name='detect node change from directory to file #2'
 rm -f $GIT_DIR/index
-git checkout -b mybranch4 remotes/git-svn
+git checkout -f -b mybranch4 remotes/git-svn
 rm -rf dir
 git update-index --remove -- dir/file
 touch dir
@@ -103,7 +104,7 @@ test_expect_code 1 "$name" \
 
 name='remove executable bit from a file'
 rm -f $GIT_DIR/index
-git checkout -b mybranch5 remotes/git-svn
+git checkout -f -b mybranch5 remotes/git-svn
 chmod -x exec.sh
 git update-index exec.sh
 git commit -m "$name"
@@ -163,6 +164,18 @@ test_expect_success "$name" \
      diff -u help $SVN_TREE/exec-2.sh"
 
 
+if test -n "$GIT_SVN_LC_ALL" && echo $GIT_SVN_LC_ALL | grep -q '\.UTF-8$'
+then
+       name="commit with UTF-8 message: locale: $GIT_SVN_LC_ALL"
+       echo '# hello' >> exec-2.sh
+       git update-index exec-2.sh
+       git commit -m 'éï∏'
+       export LC_ALL="$GIT_SVN_LC_ALL"
+       test_expect_success "$name" "git-svn commit HEAD"
+       unset LC_ALL
+else
+       echo "UTF-8 locale not set, test skipped ($GIT_SVN_LC_ALL)"
+fi
 
 name='test fetch functionality (svn => git) with alternate GIT_SVN_ID'
 GIT_SVN_ID=alt