summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-23 15:54:35 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-02-28 17:47:10 +0000
commit5353c1af710dd6200d414ecf3eeb8f61b953b805 (patch)
tree05cb61e66491c0de63b5a47d423dac1f9faa6d24 /meta/lib/oeqa
parent4a67dfb0897c36e21ada43a81d19c48765edbe56 (diff)
downloadpoky-5353c1af710dd6200d414ecf3eeb8f61b953b805.tar.gz
oeqa/utils/metadata: Add commit_count to fallback logic
Currently if python3-git isn't installed we can get odd behaviours when the commit_count is absent. Avoid this set of bugs by adding a fallback here. (From OE-Core rev: b8d22ed681141ce360d742a96cec5f2925a20222) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r--meta/lib/oeqa/utils/metadata.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/lib/oeqa/utils/metadata.py b/meta/lib/oeqa/utils/metadata.py
index b7def77224..70a27569f2 100644
--- a/meta/lib/oeqa/utils/metadata.py
+++ b/meta/lib/oeqa/utils/metadata.py
@@ -72,8 +72,10 @@ def git_rev_info(path):
72 info['commit'] = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=path).decode('utf-8').strip() 72 info['commit'] = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=path).decode('utf-8').strip()
73 except subprocess.CalledProcessError: 73 except subprocess.CalledProcessError:
74 pass 74 pass
75 return info 75 try:
76 76 info['commit_count'] = int(subprocess.check_output(["git", "rev-list", "--count", "HEAD"], cwd=path).decode('utf-8').strip())
77 except subprocess.CalledProcessError:
78 pass
77 try: 79 try:
78 repo = Repo(path, search_parent_directories=True) 80 repo = Repo(path, search_parent_directories=True)
79 except (InvalidGitRepositoryError, NoSuchPathError): 81 except (InvalidGitRepositoryError, NoSuchPathError):