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.
This commit is contained in:
parent
e5d35c4dec
commit
1375740735
1 changed files with 2 additions and 1 deletions
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue