diff options
author | Li Xinwei <1326710505@qq.com> | 2021-05-31 17:45:52 +0800 |
---|---|---|
committer | Kai Koehne <kai.koehne@qt.io> | 2021-05-31 10:58:48 +0000 |
commit | 4450693ac0f7c82d6efd99dbcaee5074ed36b4ca (patch) | |
tree | ec5a7c4a3c0a80c76d27424bc5374812c89f5083 /init-repository | |
parent | 3b2dd1560c9009c0c181a8a1dc35296aa87c79e9 (diff) |
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 7374ef8e38b6b47589ff4f2977f102fc63ab3d72
Change-Id: Ifb4e1c8de57c7729f2965c16388f1acd763a150f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'init-repository')
-rwxr-xr-x | init-repository | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/init-repository b/init-repository index 0d5593b4..60594fc7 100755 --- a/init-repository +++ b/init-repository @@ -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'); |