summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJordan Galby <67924449+Jordan474@users.noreply.github.com>2023-09-29 17:14:39 +0200
committerGitHub <noreply@github.com>2023-09-29 15:14:39 +0000
commitdb37672abf62ff67b016166bf10377b00eea5f1b (patch)
treee174af42dd32a887e075ae44c776d7f0479afb08 /lib
parent1f75ca96dfd03186eee33ded673ee3222d83489c (diff)
downloadspack-db37672abf62ff67b016166bf10377b00eea5f1b.tar.gz
spack-db37672abf62ff67b016166bf10377b00eea5f1b.tar.bz2
spack-db37672abf62ff67b016166bf10377b00eea5f1b.tar.xz
spack-db37672abf62ff67b016166bf10377b00eea5f1b.zip
Print error when missing git (#40254)
Like a missing curl.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/fetch_strategy.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/spack/spack/fetch_strategy.py b/lib/spack/spack/fetch_strategy.py
index 8578b110fc..aa96bbbe51 100644
--- a/lib/spack/spack/fetch_strategy.py
+++ b/lib/spack/spack/fetch_strategy.py
@@ -734,7 +734,11 @@ class GitFetchStrategy(VCSFetchStrategy):
@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