git-svn: enable "svn.pathnameencoding" on dcommit
Without the initialization of $self->{pathnameencoding}, conversion in repo_path() is always skipped as $self->{pathnameencoding} is undefined even if "svn.pathnameencoding" is configured. The lack of conversion results in mysterious failure of dcommit (e.g. "Malformed XML") which happen only when a commit involves a change on non-ASCII path. [ew: add test case to t9115, squash LC_ALL=$a_utf8_locale export from Kazutoshi for Cygwin] Signed-off-by: Kazutoshi SATODA <k_satoda@f2.dion.ne.jp> Signed-off-by: Eric Wong <normalperson@yhbt.net>
Kazutoshi Satoda committed
Feb 9, 2016 at 00:20 UTC
40f47448a91666be8e2befe521525f3f507344f9
2 files changed
+24
-2
perl/Git/SVN/Editor.pm
+1
@@ -41,6 +41,7 @@ sub new {
41
"$self->{svn_path}/" : '';
42
$self->{config} = $opts->{config};
43
$self->{mergeinfo} = $opts->{mergeinfo};
44
+ $self->{pathnameencoding} = Git::config('svn.pathnameencoding');
45
return $self;
46
}
47
t/t9115-git-svn-dcommit-funky-renames.sh
+23
-2
@@ -77,11 +77,32 @@ test_expect_success 'make a commit to test rebase' '
77
'
78
79
test_expect_success 'git svn rebase works inside a fresh-cloned repository' '
80
- cd test-rebase &&
80
+ (
81
+ cd test-rebase &&
82
git svn rebase &&
83
test -e test-rebase-main &&
84
test -e test-rebase
84
- '
85
+ )'
86
+
87
+# Without this, LC_ALL=C as set in test-lib.sh, and Cygwin converts
88
+# non-ASCII characters in filenames unexpectedly, and causes errors.
89
+# https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars
90
+# > Some characters are disallowed in filenames on Windows filesystems. ...
91
+# ...
92
+# > ... All of the above characters, except for the backslash, are converted
93
+# > to special UNICODE characters in the range 0xf000 to 0xf0ff (the
94
+# > "Private use area") when creating or accessing files.
95
+prepare_a_utf8_locale
96
+test_expect_success UTF8 'svn.pathnameencoding=cp932 new file on dcommit' '
97
+ LC_ALL=$a_utf8_locale &&
98
+ export LC_ALL &&
99
+ neq=$(printf "\201\202") &&
100
+ git config svn.pathnameencoding cp932 &&
101
+ echo neq >"$neq" &&
102
+ git add "$neq" &&
103
+ git commit -m "neq" &&
104
+ git svn dcommit
105
+'
106
107
stop_httpd
108