From fcfa9df1d2f2d0042ca0dae2517dbb390e9d915a Mon Sep 17 00:00:00 2001 From: Rohan McGovern Date: Mon, 16 Jan 2012 11:01:58 +1000 Subject: [PATCH] init-repository: fixed warnings when no mirror is used Don't test for the existence of the mirror if the user didn't ask to use a mirror. Change-Id: Ib5565fa9a68ba6e22a4f7a179a0f00eb998da2aa Sanity-Review: Qt Sanity Bot Reviewed-by: Jason McDonald --- init-repository | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/init-repository b/init-repository index 392521b3..9d9ebacb 100755 --- a/init-repository +++ b/init-repository @@ -572,11 +572,13 @@ sub git_clone_one_submodule $mirror =~ s/qtsoftware/gitorious/ ; } - # Only use the mirror if it can be reached. - eval { $self->exe('git', 'ls-remote', $mirror, 'test/if/mirror/exists') }; - if ($@) { - warn "mirror [$mirror] is not accessible; $url will be used\n"; - undef $mirror; + if ($mirror) { + # Only use the mirror if it can be reached. + eval { $self->exe('git', 'ls-remote', $mirror, 'test/if/mirror/exists') }; + if ($@) { + warn "mirror [$mirror] is not accessible; $url will be used\n"; + undef $mirror; + } } my $do_clone = (! -d "$submodule/.git");