diff --git a/init-repository b/init-repository index df3cf5f9..423fc856 100755 --- a/init-repository +++ b/init-repository @@ -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); }