loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Show diff on rename with diff changes (#15338)

More recent versions of git have increased support for detection of renames meaning
that a rename with diff changes is now supported.

Although ParsePatch supports this - our templates do not and the simplest solution
is simply to show the diff.

Fix #15335

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: 6543 <6543@obermui.de>

authored by

zeripath
6543
and committed by
GitHub
f544414a b62bd8e7

+8 -12
+8 -12
templates/repo/diff/box.tmpl
··· 49 49 {{svg "octicon-chevron-down" 18}} 50 50 </a> 51 51 <div class="bold ui left df ac"> 52 - {{if not $file.IsRenamed}} 53 - {{template "repo/diff/stats" dict "file" . "root" $}} 54 - {{end}} 52 + {{template "repo/diff/stats" dict "file" . "root" $}} 55 53 </div> 56 54 <span class="file mono">{{$file.Name}}</span> 57 55 <div class="diff-file-header-actions df ac"> ··· 87 85 <div class="bold df ac"> 88 86 {{if $file.IsBin}} 89 87 {{$.i18n.Tr "repo.diff.bin"}} 90 - {{else if not $file.IsRenamed}} 88 + {{else}} 91 89 {{template "repo/diff/stats" dict "file" . "root" $}} 92 90 {{end}} 93 91 </div> ··· 113 111 </div> 114 112 </h4> 115 113 <div class="diff-file-body ui attached unstackable table segment"> 116 - {{if ne $file.Type 4}} 117 - <div id="diff-source-{{$i}}" class="file-body file-code has-context-menu code-diff{{if $.IsSplitStyle}} code-diff-split{{else}} code-diff-unified{{end}}"> 118 - {{if $file.IsBin}} 114 + <div id="diff-source-{{$i}}" class="file-body file-code has-context-menu code-diff{{if $.IsSplitStyle}} code-diff-split{{else}} code-diff-unified{{end}}"> 115 + {{if $file.IsBin}} 119 116 <div class="diff-file-body binary" style="padding: 5px 10px;">{{$.i18n.Tr "repo.diff.bin_not_shown"}}</div> 120 - {{else}} 117 + {{else}} 121 118 <table class="chroma"> 122 119 {{if $.IsSplitStyle}} 123 120 {{template "repo/diff/section_split" dict "file" . "root" $}} ··· 125 122 {{template "repo/diff/section_unified" dict "file" . "root" $}} 126 123 {{end}} 127 124 </table> 128 - {{end}} 129 - </div> 130 - {{if or $isImage $isCsv}} 125 + {{end}} 126 + </div> 127 + {{if or $isImage $isCsv}} 131 128 <div id="diff-rendered-{{$i}}" class="file-body file-code has-context-menu{{if $.IsSplitStyle}} code-diff-split{{else}} code-diff-unified{{end}} hide"> 132 129 <table class="chroma w-100"> 133 130 {{if $isImage}} ··· 137 134 {{end}} 138 135 </table> 139 136 </div> 140 - {{end}} 141 137 {{end}} 142 138 </div> 143 139 </div>