Fix SPACK-87: Tag checkout fails for older git versions.

This commit is contained in:
Todd Gamblin
2015-05-18 11:25:26 -07:00
parent 76cb3eb7d2
commit b2f46c703d

View File

@@ -363,10 +363,6 @@ def __init__(self, **kwargs):
'git', 'tag', 'branch', 'commit', **kwargs)
self._git = None
# For git fetch branches and tags the same way.
if not self.branch:
self.branch = self.tag
@property
def git_version(self):
@@ -422,6 +418,12 @@ def fetch(self):
self.git(*args)
self.stage.chdir_to_source()
# For tags, be conservative and check them out AFTER
# cloning. Later git versions can do this with clone
# --branch, but older ones fail.
if self.tag:
self.git('checkout', self.tag)
def archive(self, destination):
super(GitFetchStrategy, self).archive(destination, exclude='.git')