From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Jackson Subject: [OSSTEST PATCH 02/13] git_massage_url: Make idempotent Date: Fri, 16 May 2014 19:01:29 +0100 Message-ID: <1400263300-22903-3-git-send-email-ian.jackson@eu.citrix.com> References: <1400263300-22903-1-git-send-email-ian.jackson@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WlMSg-0002EX-1a for xen-devel@lists.xenproject.org; Fri, 16 May 2014 18:02:26 +0000 In-Reply-To: <1400263300-22903-1-git-send-email-ian.jackson@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: Ian Jackson , Ian Campbell List-Id: xen-devel@lists.xenproject.org If called more than once, it should not produce a url starting with multiple copies of the git cache proxy prefix. Signed-off-by: Ian Jackson --- Osstest/TestSupport.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index c95807a..1492d9f 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -1028,7 +1028,8 @@ sub file_simple_write_contents ($$) { sub git_massage_url ($) { my ($url) = @_; - if ($url =~ m,^(git|https?)://, && $c{GitCacheProxy}) { + if ($url =~ m,^(git|https?)://, && $c{GitCacheProxy} && + substr($url,0,length($c{GitCacheProxy})) ne $c{GitCacheProxy}) { $url = $c{GitCacheProxy}.$url; } return $url; -- 1.7.10.4