@matheusbsbs / matheus-bagliano / commits / 9162b8640b
Fork 0

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 <myllai@gmail.com> Acked-by: Eric Wong <normalperson@yhbt.net>

Michael Lai committed Mar 9, 2009 at 11:45 UTC 9162b8640b4e9e199fb92eb6b8a3787f268531d5
1 file changed +4 -1
git-svn.perl
+4 -1
@@ -2351,7 +2351,10 @@ sub match_paths {
2351 if (my $path = $paths->{"/$self->{path}"}) {
2352 return ($path->{action} eq 'D') ? 0 : 1;
2353 }
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\//;
2358 if (grep /$self->{path_regex}/, keys %$paths) {
2359 return 1;
2360 }