提交 9162b864 编写于 作者: M Michael Lai 提交者: Eric Wong

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: NMichael Lai <myllai@gmail.com>
Acked-by: NEric Wong <normalperson@yhbt.net>
上级 52e77876
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册