From: Oswald Buddenhagen Date: Wed, 2 Nov 2016 17:59:19 +0000 (+0100) Subject: fix cloning of tagged versions X-Git-Tag: v5.6.3~124 X-Git-Url: http://git.qt-users.jp/git/?p=mirror%2Fqt%2Fqt5.git;a=commitdiff_plain;h=71ed40b0ace06eaa54ec41b2ad622911a94643be;hp=4cbc319413df1328df002dec311e6015977f8ec8 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 --- 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); }