()
| 257 | return info |
| 258 | |
| 259 | def update_commit_data() -> None: |
| 260 | try: |
| 261 | import git |
| 262 | |
| 263 | global last_commit_hash |
| 264 | global last_commit_date |
| 265 | global last_git_branch |
| 266 | path = Path(__file__).resolve().parent |
| 267 | repo = git.Repo(str(path), search_parent_directories=True) |
| 268 | last_commit_hash = repo.head.object.hexsha |
| 269 | last_commit_date = repo.head.object.committed_datetime.isoformat() |
| 270 | last_git_branch = repo.active_branch.name |
| 271 | except: |
| 272 | pass |
| 273 | |
| 274 | if IN_PACKAGE: |
| 275 | update_commit_data() |