Unverified 提交 014acde7 authored 作者: Glenn Jocher's avatar Glenn Jocher 提交者: GitHub

Update `git_describe()` (#7402)

* Update `git_describe()` Add .git path check to avoid `fatal: not a git repository (or any of the parent directories): .git` printout * Update general.py
上级 2da24661
......@@ -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 ''
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论