summaryrefslogtreecommitdiffstats
path: root/init-repository
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@qt.io>2016-11-02 18:59:19 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-04 12:42:26 +0000
commit71ed40b0ace06eaa54ec41b2ad622911a94643be (patch)
tree89c9624a8b23c1efcf50304e27eeaf9f14d1264e /init-repository
parent4cbc319413df1328df002dec311e6015977f8ec8 (diff)
fix cloning of tagged versions
the .gitmodules of tagged commits typically refers to a release branch which was deleted shortly after the release. consequently, git clone --branch is bound to fail. of course, cloning a fixed sha1/tag requires no branch in the first place, so revert back to using git clone --no-checkout in that case. amends ac6168c0c. Task-number: QTBUG-49133 Change-Id: Ica032f1d07a70ad89f16b23bdf5cdab785612fdc Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'init-repository')
-rwxr-xr-xinit-repository9
1 files changed, 7 insertions, 2 deletions
diff --git a/init-repository b/init-repository
index 954237d0..f7ba27e9 100755
--- a/init-repository
+++ b/init-repository
@@ -389,7 +389,8 @@ sub git_clone_all_submodules
}
foreach my $module (@modules) {
- $self->git_clone_one_submodule($subdirs{$module}, $subbases{$module}, $subbranches{$module});
+ $self->git_clone_one_submodule($subdirs{$module}, $subbases{$module},
+ $co_branch && $subbranches{$module});
}
if ($co_branch) {
@@ -482,7 +483,11 @@ sub git_clone_one_submodule
my $do_clone = (! -e "$submodule/.git");
if ($do_clone) {
- push @reference_args, '--branch', $branch if ($branch);
+ if ($branch) {
+ push @reference_args, '--branch', $branch;
+ } else {
+ push @reference_args, '--no-checkout';
+ }
$self->exe('git', 'clone', @reference_args,
($mirror ? $mirror : $url), $submodule);
}