From 5757cd8fe4a94bb8d9349aa62e617a998d9e586a Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Tue, 27 Jun 2023 09:15:55 -0400 Subject: [PATCH] allow extensions in detached git mode --- modules/extensions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/extensions.py b/modules/extensions.py index 5064f1357..0df9681e6 100644 --- a/modules/extensions.py +++ b/modules/extensions.py @@ -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"

{self.commit_hash[:8]}

{datetime.fromtimestamp(self.commit_date).strftime('%a %b%d %Y %H:%M')}

" except Exception as ex: