diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-06-28 20:40:32 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-06-28 20:55:45 -0700 |
commit | 7829f20f5beabe3e21866ae53109a58370571158 (patch) | |
tree | 14dac108a1ad33e69df09edfa08def0efb2870a9 | |
parent | 29c70e0b3e3183f86f93500882177d0c74069988 (diff) | |
download | git-7829f20f5beabe3e21866ae53109a58370571158.tar.gz git-7829f20f5beabe3e21866ae53109a58370571158.tar.xz |
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>
-rwxr-xr-x | git-svn.perl | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/git-svn.perl b/git-svn.perl index 50ace22da..f789a6eec 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -1462,13 +1462,6 @@ sub verify_remotes_sanity { } } -# we allow more chars than remotes2config.sh... -sub sanitize_remote_name { - my ($name) = @_; - $name =~ tr{A-Za-z0-9:,/+-}{.}c; - $name; -} - sub find_existing_remote { my ($url, $remotes) = @_; return undef if $no_reuse_existing; @@ -2853,7 +2846,7 @@ sub _new { unless (defined $ref_id && length $ref_id) { $_[2] = $ref_id = $Git::SVN::default_ref_id; } - $_[1] = $repo_id = sanitize_remote_name($repo_id); + $_[1] = $repo_id; my $dir = "$ENV{GIT_DIR}/svn/$ref_id"; $_[3] = $path = '' unless (defined $path); mkpath(["$ENV{GIT_DIR}/svn"]); @@ -4707,8 +4700,7 @@ sub minimize_connections { # skip existing cases where we already connect to the root if (($ra->{url} eq $ra->{repos_root}) || - (Git::SVN::sanitize_remote_name($ra->{repos_root}) eq - $repo_id)) { + ($ra->{repos_root} eq $repo_id)) { $root_repos->{$ra->{url}} = $repo_id; next; } @@ -4747,8 +4739,7 @@ sub minimize_connections { foreach my $url (keys %$new_urls) { # see if we can re-use an existing [svn-remote "repo_id"] # instead of creating a(n ugly) new section: - my $repo_id = $root_repos->{$url} || - Git::SVN::sanitize_remote_name($url); + my $repo_id = $root_repos->{$url} || $url; my $fetch = $new_urls->{$url}; foreach my $path (keys %$fetch) { |