From 71ed40b0ace06eaa54ec41b2ad622911a94643be Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 2 Nov 2016 18:59:19 +0100 Subject: [PATCH 1/1] 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 Reviewed-by: Edward Welbourne --- init-repository | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/init-repository b/init-repository index 954237d..f7ba27e 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); } -- 1.8.3.1