summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/main.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py
index b15e99f08b..33c8d1f4c6 100644
--- a/lib/spack/spack/main.py
+++ b/lib/spack/spack/main.py
@@ -128,8 +128,8 @@ def get_version():
git = exe.which("git")
if git:
with fs.working_dir(spack.paths.prefix):
- desc = git(
- "describe", "--tags", output=str, fail_on_error=False)
+ desc = git("describe", "--tags", "--match", "v*",
+ output=str, error=os.devnull, fail_on_error=False)
if git.returncode == 0:
match = re.match(r"v([^-]+)-([^-]+)-g([a-f\d]+)", desc)