diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2020-02-11 14:16:40 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2020-02-11 16:52:06 -0800 |
commit | c56c4b334d80e9cc954cac5f087dd49f3a4f1066 (patch) | |
tree | 440cf3b17322d516b5d66e00e4fca20e6accfdde /lib | |
parent | 582e7ce2c83cb18e9bc49ec7cf962fae149d155b (diff) | |
download | spack-c56c4b334d80e9cc954cac5f087dd49f3a4f1066.tar.gz spack-c56c4b334d80e9cc954cac5f087dd49f3a4f1066.tar.bz2 spack-c56c4b334d80e9cc954cac5f087dd49f3a4f1066.tar.xz spack-c56c4b334d80e9cc954cac5f087dd49f3a4f1066.zip |
bugfix: `spack -V` should use `working_dir()` instead of `git -C`
- `git -C` doesn't work on git before 1.8.5
- `working_dir` gets us the same effect
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/main.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/spack/spack/main.py b/lib/spack/spack/main.py index 4386f50435..0821b4e699 100644 --- a/lib/spack/spack/main.py +++ b/lib/spack/spack/main.py @@ -22,6 +22,7 @@ import warnings from six import StringIO import llnl.util.cpu +import llnl.util.filesystem as fs import llnl.util.tty as tty import llnl.util.tty.color as color from llnl.util.tty.log import log_output @@ -125,8 +126,9 @@ def get_version(): if os.path.exists(git_path): git = exe.which("git") if git: - desc = git("-C", spack.paths.prefix, "describe", "--tags", - output=str, fail_on_error=False) + with fs.working_dir(spack.paths.prefix): + desc = git( + "describe", "--tags", output=str, fail_on_error=False) if git.returncode == 0: match = re.match(r"v([^-]+)-([^-]+)-g([a-f\d]+)", desc) |