tests: Ensure the git tag version check does not run for tarball builds

Do not try to determine the latest git tag if we're not in a git
repository in the first place.
This commit is contained in:
Tomas Babej 2021-10-02 18:06:45 -04:00
parent 34c12a7b78
commit c2ba93cb61
No known key found for this signature in database
GPG key ID: B0747C6578F7D2F5

View file

@ -90,6 +90,8 @@ class TestVersion(TestCase):
# corresponding to "compiled from git" or "compiled from tarball"
version = out.split()
# If we are within a git repository, check the tag version
if os.path.exists("../.git"):
if 2 >= len(version) > 0:
git = version[1]
git_expected = "({0})".format(self.slurp_git())