Skip to content

Commit 0925c02

Browse files
committed
Merge git://git.bogomips.org/git-svn
* git://git.bogomips.org/git-svn: git svn: avoid unnecessary '/' in paths for SVN git-svn: strip off leading slashes on --trunk argument
2 parents 6339f67 + b1a954a commit 0925c02

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

git-svn.perl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -963,6 +963,7 @@ sub cmd_multi_init {
963963
}
964964
do_git_init_db();
965965
if (defined $_trunk) {
966+
$_trunk =~ s#^/+##;
966967
my $trunk_ref = 'refs/remotes/' . $_prefix . 'trunk';
967968
# try both old-style and new-style lookups:
968969
my $gs_trunk = eval { Git::SVN->new($trunk_ref) };
@@ -2054,6 +2055,9 @@ sub new {
20542055
"\":$ref_id\$\" in config\n";
20552056
($self->{path}, undef) = split(/\s*:\s*/, $fetch);
20562057
}
2058+
$self->{path} =~ s{/+}{/}g;
2059+
$self->{path} =~ s{\A/}{};
2060+
$self->{path} =~ s{/\z}{};
20572061
$self->{url} = command_oneline('config', '--get',
20582062
"svn-remote.$repo_id.url") or
20592063
die "Failed to read \"svn-remote.$repo_id.url\" in config\n";

0 commit comments

Comments
 (0)