mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
rendercomment: move Repository init to __init__
This makes rendercomment a slight bit more lazy. Now, it will only actually initialize a pygit2.Repository when it needs to produce a Git commit inline. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
a6ca345af4
commit
4959f62cf5
1 changed files with 1 additions and 2 deletions
|
@ -60,9 +60,8 @@ class GitCommitsInlineProcessor(markdown.inlinepatterns.InlineProcessor):
|
||||||
considered.
|
considered.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
_repo = pygit2.Repository(repo_path)
|
|
||||||
|
|
||||||
def __init__(self, md, head):
|
def __init__(self, md, head):
|
||||||
|
self._repo = pygit2.Repository(repo_path)
|
||||||
self._head = head
|
self._head = head
|
||||||
super().__init__(r'\b([0-9a-f]{7,40})\b', md)
|
super().__init__(r'\b([0-9a-f]{7,40})\b', md)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue