@@ -630,7 +630,8 @@ def clone_repository(self, url, git_ref, destination_path):
630630 """
631631 if git_ref is None :
632632 # Shallow clone is only possible if using the tip of the branch
633- clone_arguments = {"depth" : 1 }
633+ # Use `None` as value for `git clone` options with no argument
634+ clone_arguments = {"depth" : 1 , "shallow-submodules" : None , "recurse-submodules" : True }
634635 else :
635636 clone_arguments = {}
636637 cloned_repository = git .Repo .clone_from (url = url , to_path = destination_path , ** clone_arguments )
@@ -646,6 +647,7 @@ def clone_repository(self, url, git_ref, destination_path):
646647
647648 # checkout ref
648649 cloned_repository .git .checkout (git_ref )
650+ cloned_repository .git .submodule ("update" , "--init" , "--recursive" , "--recommend-shallow" )
649651
650652 def install_platforms_from_download (self , platform_list ):
651653 """Install libraries by downloading them
@@ -894,7 +896,7 @@ def get_sketch_report(self, compilation_result):
894896 previous_compilation_result = self .compile_sketch (sketch_path = compilation_result .sketch )
895897
896898 # git checkout the head ref to return the repository to its previous state
897- repository .git .checkout (original_git_ref )
899+ repository .git .checkout (original_git_ref , recurse_submodules = True )
898900
899901 previous_sizes = self .get_sizes_from_output (compilation_result = previous_compilation_result )
900902
@@ -1021,11 +1023,15 @@ def checkout_deltas_base_ref(self):
10211023
10221024 # git fetch the deltas base ref
10231025 origin_remote = repository .remotes ["origin" ]
1024- origin_remote .fetch (refspec = self .deltas_base_ref , verbose = self .verbose , no_tags = True , prune = True ,
1025- depth = 1 )
1026+ origin_remote .fetch (refspec = self .deltas_base_ref ,
1027+ verbose = self .verbose ,
1028+ no_tags = True ,
1029+ prune = True ,
1030+ depth = 1 ,
1031+ recurse_submodules = True )
10261032
10271033 # git checkout the deltas base ref
1028- repository .git .checkout (self .deltas_base_ref )
1034+ repository .git .checkout (self .deltas_base_ref , recurse_submodules = True )
10291035
10301036 def get_sizes_report (self , current_sizes , previous_sizes ):
10311037 """Return a list containing all memory usage data assembled.
0 commit comments