Subject: | git-stitch-repo creates path with additional double quote |
git fast-export uses double quotes around filenames with special utf8
characters:
D "test\303\204"
M 100644 :1 "test\303\226"
git fast-import in general can work with this.
When remapping those files to a different directory with git-stitch-repo
the new directory is prefixed in front of the quotes.
web/"test\303\226"
git fast-import failes and creates a file named web/\"test\303\226
The attached patch prefixes the new directory path after a doublequote if
present.
Subject: | stitch.patch |
--- Git-FastExport-0.07/lib/Git/FastExport/Stitch.pm.org 2012-09-20 07:23:41.000000000 +0200
+++ Git-FastExport-0.07/lib/Git/FastExport/Stitch.pm 2012-11-22 09:31:41.119311977 +0100
@@ -184,15 +184,15 @@
for ( @{ $block->{files} } ) {
s/^M (\d+) :(\d+)/M $1 :$mark_map->{$repo}{$2}/;
if ( my $dir = $self->{repo}{$repo}{dir} ) {
- s!^(M \d+ :\d+) (.*)!$1 $dir/$2!; # filemodify
- s!^D (.*)!D $dir/$1!; # filedelete
+ s!^(M \d+ :\d+) (\"?)(.*)!$1 $2$dir/$3!; # filemodify
+ s!^D (\"?)(.*)!D $1$dir/$2!; # filedelete
# /!\ quotes may happen - die and fix if needed
die "Choked on quoted paths in $repo! Culprit:\n$_\n"
if /^[CR] \S+ \S+ /;
# filecopy | filerename
- s!^([CR]) (\S+) (\S+)!$1 $dir/$2 $dir/$3!;
+ s!^([CR]) (\"?)(\S+) (\"?)(\S+)!$1 $2$dir/$3 $4$dir/$5!;
}
}
}