diff options
author | phire <me@phire.cc> | 2022-12-20 09:41:55 +0100 |
---|---|---|
committer | Anirudh Oppiliappan <x@icyphox.sh> | 2022-12-20 14:24:17 +0530 |
commit | 1375740735b2085d638b53d116c9efeb199ed4d6 (patch) | |
tree | 30ff01b7ed2ffe81f21d0a4cfb91f9f0c3c938ac | |
parent | e5d35c4deccd35a12b138d089dcd15a2c8ac18c1 (diff) | |
download | legit-1375740735b2085d638b53d116c9efeb199ed4d6.tar.gz legit-1375740735b2085d638b53d116c9efeb199ed4d6.tar.bz2 legit-1375740735b2085d638b53d116c9efeb199ed4d6.zip |
Link to parent commit file version in commit view
It makes sense for [oldfile] in [oldfile]->[newfile] to link to the
previous version. This is also how cgit behaves.
Diffstat (limited to '')
-rw-r--r-- | templates/commit.html | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/templates/commit.html b/templates/commit.html index f0c58dc..440204b 100644 --- a/templates/commit.html +++ b/templates/commit.html @@ -45,6 +45,7 @@ <section> {{ $repo := .name }} {{ $this := .commit.This }} + {{ $parent := .commit.Parent }} {{ range .diff }} <div id="{{ .Name.New }}"> <div class="diff"> @@ -58,7 +59,7 @@ <span class="diff-type">M</span> {{ end }} {{ if .Name.Old }} - <a href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.Old }}">{{ .Name.Old }}</a> + <a href="/{{ $repo }}/blob/{{ $parent }}/{{ .Name.Old }}">{{ .Name.Old }}</a> {{ if .Name.New }} → <a href="/{{ $repo }}/blob/{{ $this }}/{{ .Name.New }}">{{ .Name.New }}</a> |