diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-09-22 13:59:50 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2018-09-22 13:59:50 -0400 |
commit | b4f34988f6b0fa770756ab8531590e3a0657d1a3 (patch) | |
tree | e0d2f257b7e2f40d181f001f8ec16a6fd0dd7305 | |
parent | dc8383991e56739086b4bfa5e0ad3b0a62a487f0 (diff) |
Fix issue when commit cannot be found
-rw-r--r-- | gitsrht/git.py | 1 | ||||
-rw-r--r-- | gitsrht/templates/blob.html | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/gitsrht/git.py b/gitsrht/git.py index b254360..ac00fef 100644 --- a/gitsrht/git.py +++ b/gitsrht/git.py @@ -48,6 +48,7 @@ class AnnotatedTreeEntry: def __init__(self, repo, entry): self._entry = entry self._repo = repo + self.commit = None if entry: self.id = entry.id.hex self.name = entry.name diff --git a/gitsrht/templates/blob.html b/gitsrht/templates/blob.html index 0e1f65b..b015c98 100644 --- a/gitsrht/templates/blob.html +++ b/gitsrht/templates/blob.html @@ -32,6 +32,7 @@ </a> </span> </span> + {% if commit %} <div class="pull-right"> <a href="#">{{commit.id.hex[:8]}}</a> — <a href="#">{{commit.author.name}}</a>: @@ -41,6 +42,7 @@ </span> </div> <div class="clearfix"></div> + {% endif %} </div> </div> <div class="container-fluid"> |