aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-02-12 00:50:23 +0800
committerRunxi Yu <me@runxiyu.org>2025-02-12 00:50:23 +0800
commit13801aac9ec8502b2df3160d61fe5d897891d793 (patch)
treedcb09722d3838d5b1d8aa32e50fe98c9b4fca846 /templates
parentschema.sql: Fixes (diff)
downloadforge-13801aac9ec8502b2df3160d61fe5d897891d793.tar.gz
forge-13801aac9ec8502b2df3160d61fe5d897891d793.tar.zst
forge-13801aac9ec8502b2df3160d61fe5d897891d793.zip
repo_commit: Use /dev/null, not {a,b}/NULL, for empty files
Diffstat (limited to 'templates')
-rw-r--r--templates/repo_commit.html.tmpl12
1 files changed, 10 insertions, 2 deletions
diff --git a/templates/repo_commit.html.tmpl b/templates/repo_commit.html.tmpl
index a09f7f2..f219d2e 100644
--- a/templates/repo_commit.html.tmpl
+++ b/templates/repo_commit.html.tmpl
@@ -56,9 +56,17 @@
<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_hash }}">{{ .From.Path }}</a> {{ .From.Mode }}
+ {{ if eq .From.Path "" }}
+ --- /dev/null
+ {{ else }}
+ --- a/<a href="../tree/{{ .From.Path }}?commit={{ $parent_commit_hash }}">{{ .From.Path }}</a> {{ .From.Mode }}
+ {{ end }}
<br />
- +++ b/<a href="../tree/{{ .To.Path }}?commit={{ $commit_object.Hash }}">{{ .To.Path }}</a> {{ .To.Mode }}
+ {{ if eq .To.Path "" }}
+ +++ /dev/null
+ {{ else }}
+ +++ b/<a href="../tree/{{ .To.Path }}?commit={{ $commit_object.Hash }}">{{ .To.Path }}</a> {{ .To.Mode }}
+ {{ end }}
</span>
</label>
<div class="file-content toggle-on-content scroll">