mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 09:14:35 +02:00
allow extensions in detached git mode
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user