init-repository: Fix wrong remote URLs in cloned submodules

The cloned submodules had a wrong origin remote URL if the origin remote
of the local qt5.git repository had a trailing slash.

Fix this by stripping the trailing slash when stripping the trailing
".git" from qt5.git's remote.

Fixes: QTBUG-113793
Change-Id: I199b6e1915f67558ecfe69f7300d0f9ef0d4b232
Reviewed-by: Alexandru Croitor (OOO) <[email protected]>
Reviewed-by: Edward Welbourne <[email protected]>
(cherry picked from commit 6c40b6160e)
Reviewed-by: Qt Cherry-pick Bot <[email protected]>
This commit is contained in:
Joerg Bornemann
2023-07-12 08:48:27 +00:00
committed by Qt Cherry-pick Bot
parent 152b5beb8c
commit f03e39cb56
+1 -1
View File
@@ -669,7 +669,7 @@ sub run
chomp(my $url = `git config remote.origin.url`);
die("Have no origin remote.\n") if (!$url);
$url =~ s,\.git$,,;
$url =~ s,\.git/?$,,;
$url =~ s/((?:tqtc-)?qt5)$//;
my $qtrepo = $1 || 'qt5';
$self->{'base-url'} = $url;