From f544414a232c148d4baf2e9d807f6cbffed67928 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 8 Apr 2021 20:35:36 +0100 Subject: [PATCH] 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 Co-authored-by: 6543 <6543@obermui.de> --- templates/repo/diff/box.tmpl | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 2dcad2ba9d..4408d52575 100644 --- a/templates/repo/diff/box.tmpl +++ b/templates/repo/diff/box.tmpl @@ -49,9 +49,7 @@ {{svg "octicon-chevron-down" 18}}
- {{if not $file.IsRenamed}} - {{template "repo/diff/stats" dict "file" . "root" $}} - {{end}} + {{template "repo/diff/stats" dict "file" . "root" $}}
{{$file.Name}}
@@ -87,7 +85,7 @@
{{if $file.IsBin}} {{$.i18n.Tr "repo.diff.bin"}} - {{else if not $file.IsRenamed}} + {{else}} {{template "repo/diff/stats" dict "file" . "root" $}} {{end}}
@@ -113,11 +111,10 @@
- {{if ne $file.Type 4}} -
- {{if $file.IsBin}} +
+ {{if $file.IsBin}}
{{$.i18n.Tr "repo.diff.bin_not_shown"}}
- {{else}} + {{else}} {{if $.IsSplitStyle}} {{template "repo/diff/section_split" dict "file" . "root" $}} @@ -125,9 +122,9 @@ {{template "repo/diff/section_unified" dict "file" . "root" $}} {{end}}
- {{end}} -
- {{if or $isImage $isCsv}} + {{end}} +
+ {{if or $isImage $isCsv}}
{{if $isImage}} @@ -137,7 +134,6 @@ {{end}}
- {{end}} {{end}}