@@ -812,7 +812,7 @@ def git_clone(url, dstpath):
812
812
if GIT_CLONE_SHALLOW :
813
813
git_clone_args += ['--depth' , '1' ]
814
814
print ('Cloning from ' + url + '...' )
815
- return run ([GIT (), 'clone' ] + git_clone_args + [url , dstpath ]) == 0
815
+ return run ([GIT (), 'clone' , '--recurse-submodules' ] + git_clone_args + [url , dstpath ]) == 0
816
816
817
817
818
818
def git_checkout_and_pull (repo_path , branch_or_tag ):
@@ -827,7 +827,7 @@ def git_checkout_and_pull(repo_path, branch_or_tag):
827
827
return False
828
828
# this line assumes that the user has not gone and manually messed with the
829
829
# repo and added new remotes to ambiguate the checkout.
830
- ret = run ([GIT (), 'checkout' , '--quiet' , branch_or_tag ], repo_path )
830
+ ret = run ([GIT (), 'checkout' , '--recurse-submodules' , '-- quiet' , branch_or_tag ], repo_path )
831
831
if ret != 0 :
832
832
return False
833
833
# Test if branch_or_tag is a branch, or if it is a tag that needs to be updated
@@ -838,6 +838,7 @@ def git_checkout_and_pull(repo_path, branch_or_tag):
838
838
ret = run ([GIT (), 'merge' , '--ff-only' , 'origin/' + branch_or_tag ], repo_path )
839
839
if ret != 0 :
840
840
return False
841
+ run ([GIT (), 'submodule' , 'update' , '--init' ], repo_path , quiet = True )
841
842
except :
842
843
errlog ('git operation failed!' )
843
844
return False
0 commit comments