diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py index 0e848652ae6..c463a0e5d85 100644 --- a/lib/spack/spack/fetch_strategy.py +++ b/lib/spack/spack/fetch_strategy.py @@ -345,8 +345,7 @@ def __init__(self, **kwargs): @property def git_version(self): - git = which('git', required=True) - vstring = git('--version', return_output=True).lstrip('git version ') + vstring = self.git('--version', return_output=True).lstrip('git version ') return Version(vstring) @@ -356,6 +355,7 @@ def git(self): self._git = which('git', required=True) return self._git + @_needs_stage def fetch(self): self.stage.chdir()