twister: make git describe work without tags present

Git describe should work in eg. shallow clones when there are no tags.
Has been fixed in cmake previously, but not in twister.

Signed-off-by: Andreas Pettersson <andreaspettersson95@gmail.com>
This commit is contained in:
Andreas Pettersson 2022-03-14 08:32:23 +01:00 committed by Anas Nashif
commit d356280b54

View file

@ -2825,7 +2825,7 @@ class TestSuite(DisablePyTestCollectionMixin):
def check_zephyr_version(self):
try:
subproc = subprocess.run(["git", "describe", "--abbrev=12"],
subproc = subprocess.run(["git", "describe", "--abbrev=12", "--always"],
stdout=subprocess.PIPE,
universal_newlines=True,
cwd=ZEPHYR_BASE)