aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorMichael Lai <myllai@gmail.com>2009-03-09 11:45:47 -0700
committerEric Wong <normalperson@yhbt.net>2009-03-09 14:52:12 -0700
commit9162b8640b4e9e199fb92eb6b8a3787f268531d5 (patch)
tree51f365677696ba470b60361827969b07e2d0a7f4 /git-svn.perl
parent52e7787609d18af76a8c1befb0a06123fb7ce89e (diff)
downloadgit-9162b8640b4e9e199fb92eb6b8a3787f268531d5.tar.gz
git-9162b8640b4e9e199fb92eb6b8a3787f268531d5.tar.xz
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>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 959eb52f3..8be6be00c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2351,7 +2351,10 @@ sub match_paths {
if (my $path = $paths->{"/$self->{path}"}) {
return ($path->{action} eq 'D') ? 0 : 1;
}
- $self->{path_regex} ||= qr/^\/\Q$self->{path}\E\//;
+ my $repos_root = $self->ra->{repos_root};
+ my $extended_path = $self->{url} . '/' . $self->{path};
+ $extended_path =~ s#^\Q$repos_root\E(/|$)##;
+ $self->{path_regex} ||= qr/^\/\Q$extended_path\E\//;
if (grep /$self->{path_regex}/, keys %$paths) {
return 1;
}