build_clone: When guessing vcs from url suffix, strip cache info
PATCH 1/1 build_clone: When guessing vcs from url suffix, strip cache info
We assume that anything not containing /'s after %20' is uninteresting.
Signed-off-by Ian Jackson <[email protected]>
--- Osstest/TestSupport.pm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
Osstest/TestSupport.pm +10 -7
@@ -1045,13 +1045,16 @@ sub build_clone ($$$$) { my $timeout= 4000; my $vcs = $r{"treevcs_$which"}; - if (defined $vcs) { - } elsif ($tree =~ m/\.hg$/) { - $vcs= 'hg'; - } elsif ($tree =~ m/\.git$/) { - $vcs= 'git'; - } else { - die "unknown vcs for $which $tree "; + if (!defined $vcs) { + my $effurl = $tree; + $effurl =~ s#\%20[^/]*$##; + if ($effurl =~ m/\.hg$/) { + $vcs= 'hg'; + } elsif ($effurl =~ m/\.git$/) { + $vcs= 'git'; + } else { + die "unknown vcs for $which $tree "; + } } if ($vcs eq 'hg') {
Signature · 1 line
1.7.10.4