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 <qt_sanity_bot@ovi.com>
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
This commit is contained in:
Rohan McGovern
2012-01-16 11:01:58 +10:00
committed by Qt by Nokia
parent 013333216a
commit fcfa9df1d2

View File

@@ -572,11 +572,13 @@ sub git_clone_one_submodule
$mirror =~ s/qtsoftware/gitorious/ ; $mirror =~ s/qtsoftware/gitorious/ ;
} }
# Only use the mirror if it can be reached. if ($mirror) {
eval { $self->exe('git', 'ls-remote', $mirror, 'test/if/mirror/exists') }; # Only use the mirror if it can be reached.
if ($@) { eval { $self->exe('git', 'ls-remote', $mirror, 'test/if/mirror/exists') };
warn "mirror [$mirror] is not accessible; $url will be used\n"; if ($@) {
undef $mirror; warn "mirror [$mirror] is not accessible; $url will be used\n";
undef $mirror;
}
} }
my $do_clone = (! -d "$submodule/.git"); my $do_clone = (! -d "$submodule/.git");