Skip to content
Snippets Groups Projects
Commit 6f75f5bd authored by Todd Gamblin's avatar Todd Gamblin
Browse files

Merge pull request #88 from trws/git_depth_attempt

adding a fallback on failure with git --depth
parents f34b04e5 9174c065
No related branches found
No related tags found
No related merge requests found
...@@ -425,12 +425,21 @@ def fetch(self): ...@@ -425,12 +425,21 @@ def fetch(self):
if self.git_version > ver('1.7.10'): if self.git_version > ver('1.7.10'):
args.append('--single-branch') args.append('--single-branch')
cloned = False
# Yet more efficiency, only download a 1-commit deep tree # Yet more efficiency, only download a 1-commit deep tree
if self.git_version >= ver('1.7.1'): if self.git_version >= ver('1.7.1'):
args.extend(['--depth','1']) try:
self.git(*(args + ['--depth','1', self.url]))
cloned = True
except spack.error.SpackError:
# This will fail with the dumb HTTP transport
# continue and try without depth, cleanup first
pass
if not cloned:
args.append(self.url)
self.git(*args)
args.append(self.url)
self.git(*args)
self.stage.chdir_to_source() self.stage.chdir_to_source()
# For tags, be conservative and check them out AFTER # For tags, be conservative and check them out AFTER
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment