Merge pull request #88 from trws/git_depth_attempt
adding a fallback on failure with git --depth
This commit is contained in:
		| @@ -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) |                 args.append(self.url) | ||||||
|                 self.git(*args) |                 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 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Todd Gamblin
					Todd Gamblin