diff --git a/lib/App/cpanminus/script.pm b/lib/App/cpanminus/script.pm index 5eb09919a..86c6141ab 100644 --- a/lib/App/cpanminus/script.pm +++ b/lib/App/cpanminus/script.pm @@ -1902,7 +1902,7 @@ sub git_uri { my $dir = File::Temp::tempdir(CLEANUP => 1); $self->mask_output( diag_progress => "Cloning $uri" ); - $self->run([ 'git', 'clone', $uri, $dir ]); + $self->run([ 'git', 'clone','--recurse-submodules', $uri, $dir ]); unless (-e "$dir/.git") { $self->diag_fail("Failed cloning git repository $uri", 1); @@ -1917,6 +1917,13 @@ sub git_uri { $self->diag_fail("Failed to checkout '$commitish' in git repository $uri\n"); return; } + if (-e "$dir/.gitmodules") { + unless ($self->run([ 'git', 'submodule','update'])) { + $self->diag_fail("Failed to checkout the submoudules in git repository $uri\n"); + return; + } + } + } $self->diag_ok;