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:
parent
ce3ab503de
commit
ea2f6b89e9
1 changed files with 4 additions and 13 deletions
|
@ -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')
|
||||
|
|
Loading…
Reference in a new issue