mirror of
git://code.qt.io/qt/qt5.git
synced 2026-03-17 09:46:08 +08:00
init-repository: avoid failure when combining `--force' and mirrors
Avoid a fatal error if the `mirror' remote already exists. Reviewed-by: Sunil Thaha Change-Id: Id6225fad265abb575f6f35f750ba7aed7729e0dc
This commit is contained in:
@@ -479,6 +479,13 @@ sub git_clone_one_submodule
|
||||
|
||||
if ($mirror) {
|
||||
$self->exe('git', 'config', 'remote.origin.url', $url);
|
||||
|
||||
# In `force' mode, remove the mirror if it already exists,
|
||||
# since we may be reinitializing the module.
|
||||
if ($self->{force}) {
|
||||
eval { $self->exe('git', 'remote', 'rm', 'mirror'); }; # failure is OK
|
||||
}
|
||||
|
||||
$self->exe('git', 'remote', 'add', 'mirror', $mirror);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user