summaryrefslogtreecommitdiffstats
path: root/init-repository
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2012-01-16 11:01:58 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-16 02:26:25 +0100
commitfcfa9df1d2f2d0042ca0dae2517dbb390e9d915a (patch)
treec0b76b1d6d62daad1990f4211507dd515271dd18 /init-repository
parent013333216a7d3716a5825dbaf463f6e29a57ffb9 (diff)
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>
Diffstat (limited to 'init-repository')
-rwxr-xr-xinit-repository12
1 files 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");