This commit is contained in:
Miroslav Stampar
2019-05-13 11:08:25 +02:00
parent c4f09a8e8a
commit 10be8a12bd
5 changed files with 22 additions and 12 deletions

View File

@@ -9,6 +9,8 @@ import os
import re
import subprocess
from lib.core.common import getText
def getRevisionNumber():
"""
Returns abbreviated commit hash number as retrieved with "git rev-parse --short HEAD"
@@ -50,7 +52,7 @@ def getRevisionNumber():
try:
process = subprocess.Popen("git rev-parse --verify HEAD", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, _ = process.communicate()
match = re.search(r"(?i)[0-9a-f]{32}", stdout or "")
match = re.search(r"(?i)[0-9a-f]{32}", getText(stdout or ""))
retVal = match.group(0) if match else None
except:
pass