Skip to content

Commit 9162b86

Browse files
Michael LaiEric Wong
authored andcommitted
git-svn: support intermediate paths when matching tags/branches
For repositories laid out like the following: [svn-remote "svn"] url = http://foo.com/svn/repos/bar fetch = myproject/trunk:refs/remotes/trunk branches = bar/myproject/branches/*:refs/remotes/* tags = bar/myproject/tags/*:refs/remotes/tags/* The "bar" component above is considered the intermediate path and was not handled correctly. Signed-off-by: Michael Lai <[email protected]> Acked-by: Eric Wong <[email protected]>
1 parent 52e7787 commit 9162b86

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

git-svn.perl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2351,7 +2351,10 @@ sub match_paths {
23512351
if (my $path = $paths->{"/$self->{path}"}) {
23522352
return ($path->{action} eq 'D') ? 0 : 1;
23532353
}
2354-
$self->{path_regex} ||= qr/^\/\Q$self->{path}\E\//;
2354+
my $repos_root = $self->ra->{repos_root};
2355+
my $extended_path = $self->{url} . '/' . $self->{path};
2356+
$extended_path =~ s#^\Q$repos_root\E(/|$)##;
2357+
$self->{path_regex} ||= qr/^\/\Q$extended_path\E\//;
23552358
if (grep /$self->{path_regex}/, keys %$paths) {
23562359
return 1;
23572360
}

0 commit comments

Comments
 (0)