summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-09-22 13:59:50 -0400
committerDrew DeVault <sir@cmpwn.com>2018-09-22 13:59:50 -0400
commitb4f34988f6b0fa770756ab8531590e3a0657d1a3 (patch)
treee0d2f257b7e2f40d181f001f8ec16a6fd0dd7305
parentdc8383991e56739086b4bfa5e0ad3b0a62a487f0 (diff)
Fix issue when commit cannot be found
-rw-r--r--gitsrht/git.py1
-rw-r--r--gitsrht/templates/blob.html2
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> &mdash;
<a href="#">{{commit.author.name}}</a>:
@@ -41,6 +42,7 @@
</span>
</div>
<div class="clearfix"></div>
+ {% endif %}
</div>
</div>
<div class="container-fluid">