From: Ian Jackson Subject: [OSSTEST PATCH 02/11] adhoc-revtuple-generator: Do not always reclone Date: Mon, 30 Jun 2014 11:21:40 +0100 Message-ID: <1404123709-32332-3-git-send-email-ian.jackson@eu.citrix.com> References: <1404123709-32332-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.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1X1YjC-0001sk-BH for xen-devel@lists.xenproject.org; Mon, 30 Jun 2014 10:22:26 +0000 In-Reply-To: <1404123709-32332-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 Instead, try setting the `origin' remote's URL and fetching. If that fails it may be that the local repo is corrupted, so then we try recloning. Signed-off-by: Ian Jackson --- adhoc-revtuple-generator | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/adhoc-revtuple-generator b/adhoc-revtuple-generator index dbe4773..f94f189 100755 --- a/adhoc-revtuple-generator +++ b/adhoc-revtuple-generator @@ -99,9 +99,17 @@ sub git_generator ($) { my $treename= $tree->{Treename}; my $eff_url = git_massage_url($tree->{Url}); my $upcmd= <&2 - rm -rf $c{Repos}/$treename - git clone --bare $eff_url $c{Repos}/$treename + set -xe; exec >&2 + if ! sh -xe <