git svn: fix fetch where glob is on the top-level URL
In cases where the top-level URL we're tracking is the path we
glob against, we can once again track odd repositories that keep
branches/tags at the top level. This regression was introduced
in commit 6f5748e14c
.
Thanks to Daniel Cordero for the original bug report and
bisection.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
parent
610f99ec7d
commit
ffd5c8e457
@ -1765,7 +1765,7 @@ sub read_all_remotes {
|
|||||||
my $use_svm_props = eval { command_oneline(qw/config --bool
|
my $use_svm_props = eval { command_oneline(qw/config --bool
|
||||||
svn.useSvmProps/) };
|
svn.useSvmProps/) };
|
||||||
$use_svm_props = $use_svm_props eq 'true' if $use_svm_props;
|
$use_svm_props = $use_svm_props eq 'true' if $use_svm_props;
|
||||||
my $svn_refspec = qr{\s*/?(.*?)\s*:\s*(.+?)\s*};
|
my $svn_refspec = qr{\s*(.*?)\s*:\s*(.+?)\s*};
|
||||||
foreach (grep { s/^svn-remote\.// } command(qw/config -l/)) {
|
foreach (grep { s/^svn-remote\.// } command(qw/config -l/)) {
|
||||||
if (m!^(.+)\.fetch=$svn_refspec$!) {
|
if (m!^(.+)\.fetch=$svn_refspec$!) {
|
||||||
my ($remote, $local_ref, $remote_ref) = ($1, $2, $3);
|
my ($remote, $local_ref, $remote_ref) = ($1, $2, $3);
|
||||||
@ -1979,7 +1979,7 @@ sub find_ref {
|
|||||||
my ($ref_id) = @_;
|
my ($ref_id) = @_;
|
||||||
foreach (command(qw/config -l/)) {
|
foreach (command(qw/config -l/)) {
|
||||||
next unless m!^svn-remote\.(.+)\.fetch=
|
next unless m!^svn-remote\.(.+)\.fetch=
|
||||||
\s*/?(.*?)\s*:\s*(.+?)\s*$!x;
|
\s*(.*?)\s*:\s*(.+?)\s*$!x;
|
||||||
my ($repo_id, $path, $ref) = ($1, $2, $3);
|
my ($repo_id, $path, $ref) = ($1, $2, $3);
|
||||||
if ($ref eq $ref_id) {
|
if ($ref eq $ref_id) {
|
||||||
$path = '' if ($path =~ m#^\./?#);
|
$path = '' if ($path =~ m#^\./?#);
|
||||||
|
Loading…
Reference in New Issue
Block a user