[Xen-devel,OSSTEST] TestSupport: Don't use git proxy for non-git:// urls.

Message ID 1392214594-26668-1-git-send-email-ian.campbell@citrix.com
State New
Headers show

Commit Message

Ian Campbell Feb. 12, 2014, 2:16 p.m.
After this I was stymied by ssh host keys and other roadblocks and just pushed
the branch to my xenbits tree but I think this is still correct as far as it
goes.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---
 Osstest/TestSupport.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ian Campbell Feb. 12, 2014, 2:54 p.m. | #1
On Wed, 2014-02-12 at 14:51 +0000, Ian Jackson wrote:
> Ian Campbell writes ("[PATCH OSSTEST] TestSupport: Don't use git proxy for non-git:// urls."):
> > After this I was stymied by ssh host keys and other roadblocks and
> > just pushed the branch to my xenbits tree but I think this is still
> > correct as far as it goes.
> 
> This should probably be made to work for http:// and https://, at
> least.

The proxy supports those?

Trivial enough patch, I'll put it on my list.

Ian.

Patch

diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm
index 236083e..45e5ecb 100644
--- a/Osstest/TestSupport.pm
+++ b/Osstest/TestSupport.pm
@@ -988,7 +988,9 @@  sub file_simple_write_contents ($$) {
 sub git_massage_url ($) {
     my ($url) = @_;
 
-    if ($c{GitCacheProxy}) { $url = $c{GitCacheProxy}.$url; }
+    if ($url =~ m,^git://, && $c{GitCacheProxy}) {
+	$url = $c{GitCacheProxy}.$url;
+    }
     return $url;
 }