X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-svn.perl;h=19d6848d0e7754b9afb9fdbbac6fce31286468a5;hb=6bead0c3203431ca63a6b1e7cf47c659f1a7021d;hp=b3b6964f95976ba885a277de9d463a2443dd3147;hpb=1bdd46cd3a2fe1e0aeb965fb0edb493064e24495;p=git.git diff --git a/git-svn.perl b/git-svn.perl index b3b6964f9..19d6848d0 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -963,6 +963,7 @@ sub cmd_multi_init { } do_git_init_db(); if (defined $_trunk) { + $_trunk =~ s#^/+##; my $trunk_ref = 'refs/remotes/' . $_prefix . 'trunk'; # try both old-style and new-style lookups: my $gs_trunk = eval { Git::SVN->new($trunk_ref) }; @@ -2054,6 +2055,9 @@ sub new { "\":$ref_id\$\" in config\n"; ($self->{path}, undef) = split(/\s*:\s*/, $fetch); } + $self->{path} =~ s{/+}{/}g; + $self->{path} =~ s{\A/}{}; + $self->{path} =~ s{/\z}{}; $self->{url} = command_oneline('config', '--get', "svn-remote.$repo_id.url") or die "Failed to read \"svn-remote.$repo_id.url\" in config\n"; @@ -2836,8 +2840,9 @@ sub mkemptydirs { foreach my $d (sort keys %empty_dirs) { $d = uri_decode($d); $d =~ s/$strip//; + next unless length($d); next if -d $d; - if (-e _) { + if (-e $d) { warn "$d exists but is not a directory\n"; } else { print "creating empty directory: $d\n";