aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--handle_repo_commit.go2
-rw-r--r--templates/repo_commit.html.tmpl12
2 files changed, 11 insertions, 3 deletions
diff --git a/handle_repo_commit.go b/handle_repo_commit.go
index af04d69..0570056 100644
--- a/handle_repo_commit.go
+++ b/handle_repo_commit.go
@@ -127,5 +127,5 @@ func (f fake_diff_file) Path() string {
var fake_diff_file_null = fake_diff_file{
hash: plumbing.NewHash("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"),
mode: misc.First_or_panic(filemode.New("100644")),
- path: "NULL",
+ path: "",
}
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">