[oe-commits] [openembedded-core] 07/08: oeqa/utils/metadata: Add commit_count to fallback logic

git at git.openembedded.org git at git.openembedded.org
Thu Feb 28 17:50:08 UTC 2019

This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit b8d22ed681141ce360d742a96cec5f2925a20222
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Sat Feb 23 15:54:35 2019 +0000

    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.
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
 meta/lib/oeqa/utils/metadata.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oeqa/utils/metadata.py b/meta/lib/oeqa/utils/metadata.py
index b7def77..70a2756 100644
--- a/meta/lib/oeqa/utils/metadata.py
+++ b/meta/lib/oeqa/utils/metadata.py
@@ -72,8 +72,10 @@ def git_rev_info(path):
             info['commit'] = subprocess.check_output(["git", "rev-parse", "HEAD"], cwd=path).decode('utf-8').strip()
         except subprocess.CalledProcessError:
-        return info
+        try:
+            info['commit_count'] = int(subprocess.check_output(["git", "rev-list", "--count", "HEAD"], cwd=path).decode('utf-8').strip())
+        except subprocess.CalledProcessError:
+            pass
         repo = Repo(path, search_parent_directories=True)
     except (InvalidGitRepositoryError, NoSuchPathError):

To stop receiving notification emails like this one, please contact
the administrator of this repository.

More information about the Openembedded-commits mailing list