]> xenbits.xensource.com Git - osstest.git/commitdiff
build_clone: When guessing vcs from url suffix, strip cache info flight-26977 flight-26997 flight-27012 flight-27031 flight-27032 flight-27033 flight-27034 flight-27038 flight-27042 flight-27043 flight-27044 flight-27045 flight-27047 flight-27048 flight-27049 flight-27050 flight-27051 flight-27052 flight-27055 flight-27056 flight-27057 flight-27060 flight-27061 flight-27062 flight-27063
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 5 Jun 2014 10:15:46 +0000 (11:15 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 5 Jun 2014 10:15:46 +0000 (11:15 +0100)
We assume that anything not containing `/'s after `%20' is
uninteresting.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Osstest/TestSupport.pm

index 4187b6cf08c9c3865527040e58faf0055fec8424..93c8fcf8501c193009b145aeefc391d60c26efbc 100644 (file)
@@ -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') {