Skip to content

Commit 7829f20

Browse files
Eric Wonggitster
authored andcommitted
git-svn: don't sanitize remote names in config
The original sanitization code was just taken from the remotes2config.sh shell script in contrib. Credit to Avery Pennarun for noticing this mistake, and Junio for clarifying the rules for config section names: Junio C Hamano wrote in <7vfxr23s6m.fsf@gitster.siamese.dyndns.org>: > In > > [foo "bar"] baz = value > > foo and baz must be config.c::iskeychar() (and baz must be isalpha()), but > "bar" can be almost anything. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 29c70e0 commit 7829f20

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

git-svn.perl

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,13 +1462,6 @@ sub verify_remotes_sanity {
14621462
}
14631463
}
14641464

1465-
# we allow more chars than remotes2config.sh...
1466-
sub sanitize_remote_name {
1467-
my ($name) = @_;
1468-
$name =~ tr{A-Za-z0-9:,/+-}{.}c;
1469-
$name;
1470-
}
1471-
14721465
sub find_existing_remote {
14731466
my ($url, $remotes) = @_;
14741467
return undef if $no_reuse_existing;
@@ -2853,7 +2846,7 @@ sub _new {
28532846
unless (defined $ref_id && length $ref_id) {
28542847
$_[2] = $ref_id = $Git::SVN::default_ref_id;
28552848
}
2856-
$_[1] = $repo_id = sanitize_remote_name($repo_id);
2849+
$_[1] = $repo_id;
28572850
my $dir = "$ENV{GIT_DIR}/svn/$ref_id";
28582851
$_[3] = $path = '' unless (defined $path);
28592852
mkpath(["$ENV{GIT_DIR}/svn"]);
@@ -4707,8 +4700,7 @@ sub minimize_connections {
47074700

47084701
# skip existing cases where we already connect to the root
47094702
if (($ra->{url} eq $ra->{repos_root}) ||
4710-
(Git::SVN::sanitize_remote_name($ra->{repos_root}) eq
4711-
$repo_id)) {
4703+
($ra->{repos_root} eq $repo_id)) {
47124704
$root_repos->{$ra->{url}} = $repo_id;
47134705
next;
47144706
}
@@ -4747,8 +4739,7 @@ sub minimize_connections {
47474739
foreach my $url (keys %$new_urls) {
47484740
# see if we can re-use an existing [svn-remote "repo_id"]
47494741
# instead of creating a(n ugly) new section:
4750-
my $repo_id = $root_repos->{$url} ||
4751-
Git::SVN::sanitize_remote_name($url);
4742+
my $repo_id = $root_repos->{$url} || $url;
47524743

47534744
my $fetch = $new_urls->{$url};
47544745
foreach my $path (keys %$fetch) {

0 commit comments

Comments
 (0)