fetch: do full clone of git submodules (fix #3956) (#3958)

The required hash of a submodule might point to the
non-HEAD commit of the current main branch and hence
would lead to a "no such remote ref" at checkout in
a shallow submodule.
This commit is contained in:
Christoph Junghans 2017-04-29 17:58:52 -07:00 committed by Todd Gamblin
parent ce3ab503de
commit ea2f6b89e9

View file

@ -686,20 +686,11 @@ def fetch(self):
# Init submodules if the user asked for them.
if self.submodules:
# only git 1.8.4 and later have --depth option
if self.git_version < ver('1.8.4'):
if spack.debug:
self.git('submodule', 'update', '--init', '--recursive')
else:
self.git('submodule', '--quiet', 'update', '--init',
'--recursive')
else:
if spack.debug:
self.git('submodule', 'update', '--init', '--recursive',
'--depth=1')
else:
self.git('submodule', '--quiet', 'update', '--init',
'--recursive', '--depth=1')
def archive(self, destination):
super(GitFetchStrategy, self).archive(destination, exclude='.git')