aboutsummaryrefslogtreecommitdiff
path: root/templates/repo_commit.html.tmpl
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-11 23:48:21 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-11 23:48:21 +0800
commit06e0f39b56b796ed2b5f94c0d37899aff410e6c6 (patch)
tree6961257c56a77b9b73e8c63a6776560214f79082 /templates/repo_commit.html.tmpl
parentrepo_commit: Don't crash on null from/to files (diff)
downloadforge-06e0f39b56b796ed2b5f94c0d37899aff410e6c6.tar.gz
forge-06e0f39b56b796ed2b5f94c0d37899aff410e6c6.tar.zst
forge-06e0f39b56b796ed2b5f94c0d37899aff410e6c6.zip
repo_commit: Don't crash when viewing the first commit
Diffstat (limited to 'templates/repo_commit.html.tmpl')
-rw-r--r--templates/repo_commit.html.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/repo_commit.html.tmpl b/templates/repo_commit.html.tmpl
index d568887..13832a8 100644
--- a/templates/repo_commit.html.tmpl
+++ b/templates/repo_commit.html.tmpl
@@ -46,14 +46,14 @@
</table>
</div>
<div class="padding-wrapper">
- {{ $parent_commit_object := .parent_commit_object }}
+ {{ $parent_commit_hash := .parent_commit_hash }}
{{ $commit_object := .commit_object }}
{{ range .file_patches }}
<div class="file-patch toggle-on-wrapper">
<input type="checkbox" id="toggle-{{ .From.Hash }}{{ .To.Hash }}" class="file-toggle toggle-on-toggle">
<label for="toggle-{{ .From.Hash }}{{ .To.Hash }}" class="file-header toggle-on-header">
<span>
- --- a/<a href="../tree/{{ .From.Path }}?commit={{ $parent_commit_object.Hash }}">{{ .From.Path }}</a> {{ .From.Mode }}
+ --- a/<a href="../tree/{{ .From.Path }}?commit={{ $parent_commit_hash }}">{{ .From.Path }}</a> {{ .From.Mode }}
<br />
+++ b/<a href="../tree/{{ .To.Path }}?commit={{ $commit_object.Hash }}">{{ .To.Path }}</a> {{ .To.Mode }}
</span>