git-svnimport: clean svn path when accessing SVN repo
Clean svn path from leading '/' when accessing SVN repo. Signed-off-by: Sasha Khapyorsky <sashak@voltaire.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Sasha Khapyorsky committed
Jan 7, 2007 at 02:22 UTC
09c3a408da1d02a3ea1119694b5deaeb14c20d65
1 file changed
+4
git-svnimport.perl
+4
@@ -148,6 +148,7 @@ sub file {
148
print "... $rev $path ...\n" if $opt_v;
149
my (undef, $properties);
150
my $pool = SVN::Pool->new();
151
+ $path =~ s#^/*##;
152
eval { (undef, $properties)
153
= $self->{'svn'}->get_file($path,$rev,$fh,$pool); };
154
$pool->clear;
@@ -183,6 +184,7 @@ sub ignore {
184
my($self,$path,$rev) = @_;
185
186
print "... $rev $path ...\n" if $opt_v;
187
+ $path =~ s#^/*##;
188
my (undef,undef,$properties)
189
= $self->{'svn'}->get_dir($path,$rev,undef);
190
if (exists $properties->{'svn:ignore'}) {
@@ -199,6 +201,7 @@ sub ignore {
201
202
sub dir_list {
203
my($self,$path,$rev) = @_;
204
+ $path =~ s#^/*##;
205
my ($dirents,undef,$properties)
206
= $self->{'svn'}->get_dir($path,$rev,undef);
207
return $dirents;
@@ -356,6 +359,7 @@ open BRANCHES,">>", "$git_dir/svn2git";
359
sub node_kind($$) {
360
my ($svnpath, $revision) = @_;
361
my $pool=SVN::Pool->new;
362
+ $svnpath =~ s#^/*##;
363
my $kind = $svn->{'svn'}->check_path($svnpath,$revision,$pool);
364
$pool->clear;
365
return $kind;