From b1bfd7ca0c321c52111b5cc2d4e1b431201f3a5d Mon Sep 17 00:00:00 2001 From: Fabien Chouteau Date: Mon, 13 Jul 2020 18:04:33 +0200 Subject: [PATCH] Alire.VCSS.Git: always clone recursively (#471) Git submodules are often mandatory parts of a repository. --- src/alire/alire-vcss-git.adb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/alire/alire-vcss-git.adb b/src/alire/alire-vcss-git.adb index 44886b78..55dd1eae 100644 --- a/src/alire/alire-vcss-git.adb +++ b/src/alire/alire-vcss-git.adb @@ -74,15 +74,21 @@ package body Alire.VCSs.Git is begin Trace.Detail ("Checking out [git]: " & From); - Run_Git (Empty_Vector & "clone" & Extra & Repo (From) & Into); + Run_Git (Empty_Vector & "clone" & "--recursive" & + Extra & Repo (From) & Into); if Commit (From) /= "" then declare Guard : Directories.Guard (Directories.Enter (Into)) with Unreferenced; begin - Run_Git (Empty_Vector & "checkout" & "-q" & Commit (From)); + -- Checkout a specific commit. -- "-q" needed to avoid the "detached HEAD" warning from git + Run_Git (Empty_Vector & "checkout" & "-q" & Commit (From)); + + -- Update the submodules, if any + Run_Git (Empty_Vector & "submodule" & "update" & + "--init" & "--recursive" & Extra); end; end if; -- 2.39.5