]> code.ossystems Code Review - openembedded-core.git/commitdiff
metadata.py: return info after fallback methods
authorChen Qi <Qi.Chen@windriver.com>
Thu, 7 Mar 2019 08:41:33 +0000 (16:41 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 7 Mar 2019 12:59:22 +0000 (12:59 +0000)
If python3 git module is not installed, we fall back to some git
command to get info. A previous commit (b8d22ed6) accidently deleted
the return statement, causing errors like below.

  Exception: UnboundLocalError: local variable 'InvalidGitRepositoryError' referenced before assignment

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/utils/metadata.py

index 70a27569f26dc6a59807069c17eb23aad242b9fb..e0808ae0ac2cf64cc3ec55cd697826268dbe1787 100644 (file)
@@ -76,6 +76,7 @@ def git_rev_info(path):
             info['commit_count'] = int(subprocess.check_output(["git", "rev-list", "--count", "HEAD"], cwd=path).decode('utf-8').strip())
         except subprocess.CalledProcessError:
             pass
+        return info
     try:
         repo = Repo(path, search_parent_directories=True)
     except (InvalidGitRepositoryError, NoSuchPathError):