allow extensions in detached git mode

This commit is contained in:
Vladimir Mandic
2023-06-27 09:15:55 -04:00
parent 2a41bf1406
commit 5757cd8fe4
+5 -2
View File
@@ -60,8 +60,11 @@ class Extension:
self.remote = next(repo.remote().urls, None)
head = repo.head.commit
self.commit_date = repo.head.commit.committed_date
if repo.active_branch:
self.branch = repo.active_branch.name
try:
if repo.active_branch:
self.branch = repo.active_branch.name
except Exception:
pass
self.commit_hash = head.hexsha
self.version = f"<p>{self.commit_hash[:8]}</p><p>{datetime.fromtimestamp(self.commit_date).strftime('%a %b%d %Y %H:%M')}</p>"
except Exception as ex: