@@ -630,7 +630,8 @@ def clone_repository(self, url, git_ref, destination_path):
630
630
"""
631
631
if git_ref is None :
632
632
# 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 }
634
635
else :
635
636
clone_arguments = {}
636
637
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):
646
647
647
648
# checkout ref
648
649
cloned_repository .git .checkout (git_ref )
650
+ cloned_repository .git .submodule ("update" , "--init" , "--recursive" , "--recommend-shallow" )
649
651
650
652
def install_platforms_from_download (self , platform_list ):
651
653
"""Install libraries by downloading them
@@ -894,7 +896,7 @@ def get_sketch_report(self, compilation_result):
894
896
previous_compilation_result = self .compile_sketch (sketch_path = compilation_result .sketch )
895
897
896
898
# 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 )
898
900
899
901
previous_sizes = self .get_sizes_from_output (compilation_result = previous_compilation_result )
900
902
@@ -1021,11 +1023,15 @@ def checkout_deltas_base_ref(self):
1021
1023
1022
1024
# git fetch the deltas base ref
1023
1025
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 )
1026
1032
1027
1033
# 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 )
1029
1035
1030
1036
def get_sizes_report (self , current_sizes , previous_sizes ):
1031
1037
"""Return a list containing all memory usage data assembled.
0 commit comments