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>
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):