Skip to content

Commit 6e376ba

Browse files
authored
Merge pull request #402 from simvue-io/hotfix/fix-git-metadata
Fix broken git metadata when not git repo
2 parents dcd4860 + 10f9290 commit 6e376ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

simvue/metadata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ def git_info(repository: str) -> dict[str, typing.Any]:
3030
"""
3131
try:
3232
git_repo = git.Repo(repository, search_parent_directories=True)
33-
except (git.InvalidGitRepositoryError, ValueError):
3433
current_commit: git.Commit = git_repo.head.commit
3534
author_list: set[str] = set(
3635
email
@@ -64,4 +63,5 @@ def git_info(repository: str) -> dict[str, typing.Any]:
6463
"git.url": git_repo.remote().url,
6564
"git.dirty": dirty,
6665
}
67-
return {}
66+
except (git.InvalidGitRepositoryError, ValueError):
67+
return {}

0 commit comments

Comments
 (0)