mirror of
git://code.qt.io/qt/qt5.git
synced 2025-12-21 15:38:15 +08:00
Fix --mirror option for init-repository
If submodule url is absolute, don't use mirror, don't set
remote.gerrit.url and remote.gerrit.fetch.
To avoid error when passing "--mirror git://github.com/qt/":
fatal: remote error: qt/https://code.qt.io/playground/qlitehtml
is not a valid repository name
Visit https://support.github.com/ for help
amends 7374ef8e38
Change-Id: Ifb4e1c8de57c7729f2965c16388f1acd763a150f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This commit is contained in:
@@ -532,7 +532,7 @@ sub git_clone_one_submodule
|
||||
}
|
||||
|
||||
my $mirror;
|
||||
if ($mirror_url && ($do_clone || $self->{fetch})) {
|
||||
if (!has_url_scheme($repo_basename) && $mirror_url && ($do_clone || $self->{fetch})) {
|
||||
$mirror = $mirror_url.$repo_basename;
|
||||
}
|
||||
|
||||
@@ -582,7 +582,9 @@ sub git_clone_one_submodule
|
||||
$self->exe('git', 'config', 'commit.template', $template);
|
||||
}
|
||||
|
||||
$self->git_add_remotes($repo_basename);
|
||||
if (!has_url_scheme($repo_basename)) {
|
||||
$self->git_add_remotes($repo_basename);
|
||||
}
|
||||
|
||||
if ($self->{'detach-alternates'}) {
|
||||
$self->exe('git', 'repack', '-a');
|
||||
|
||||
Reference in New Issue
Block a user