diff --git a/utils/general.py b/utils/general.py index 6c2558db74c4..daef2a427111 100755 --- a/utils/general.py +++ b/utils/general.py @@ -275,6 +275,7 @@ def check_online(): def git_describe(path=ROOT): # path must be a directory # Return human-readable git description, i.e. v5.0-5-g3e25f1e https://git-scm.com/docs/git-describe try: + assert (Path(path) / '.git').is_dir() return check_output(f'git -C {path} describe --tags --long --always', shell=True).decode()[:-1] except Exception: return ''