Print error when missing git (#40254)

Like a missing curl.
This commit is contained in:
Jordan Galby 2023-09-29 17:14:39 +02:00 committed by Harmen Stoppels
parent d3c0da48d9
commit ca77a3013f

View File

@ -763,7 +763,11 @@ def version_from_git(git_exe):
@property
def git(self):
if not self._git:
self._git = spack.util.git.git()
try:
self._git = spack.util.git.git(required=True)
except CommandNotFoundError as exc:
tty.error(str(exc))
raise
# Disable advice for a quieter fetch
# https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.2.txt