@matheusbsbs / matheus-bagliano / commits / 7829f20f5b
Fork 0

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>

Eric Wong committed Jun 28, 2008 at 20:40 UTC 7829f20f5beabe3e21866ae53109a58370571158
1 file changed +3 -12
git-svn.perl
+3 -12
@@ -1462,13 +1462,6 @@ sub verify_remotes_sanity {
1462 }
1463 }
1464
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 -
1465 sub find_existing_remote {
1466 my ($url, $remotes) = @_;
1467 return undef if $no_reuse_existing;
@@ -2853,7 +2846,7 @@ sub _new {
2846 unless (defined $ref_id && length $ref_id) {
2847 $_[2] = $ref_id = $Git::SVN::default_ref_id;
2848 }
2856 - $_[1] = $repo_id = sanitize_remote_name($repo_id);
2849 + $_[1] = $repo_id;
2850 my $dir = "$ENV{GIT_DIR}/svn/$ref_id";
2851 $_[3] = $path = '' unless (defined $path);
2852 mkpath(["$ENV{GIT_DIR}/svn"]);
@@ -4707,8 +4700,7 @@ sub minimize_connections {
4700
4701 # skip existing cases where we already connect to the root
4702 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)) {
4704 $root_repos->{$ra->{url}} = $repo_id;
4705 next;
4706 }
@@ -4747,8 +4739,7 @@ sub minimize_connections {
4739 foreach my $url (keys %$new_urls) {
4740 # see if we can re-use an existing [svn-remote "repo_id"]
4741 # 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;
4743
4744 my $fetch = $new_urls->{$url};
4745 foreach my $path (keys %$fetch) {