From 16e34025b41e1f9d14fdf0d86c5d8f08de1dc4a4 Mon Sep 17 00:00:00 2001 From: zeripath Date: Thu, 8 Apr 2021 20:36:17 +0100 Subject: [PATCH] Show diff on rename with diff changes (#15338) (#15339) Backport #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 | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/templates/repo/diff/box.tmpl b/templates/repo/diff/box.tmpl index 32e21202ff..c9be673662 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}}
@@ -85,7 +83,7 @@
{{if $file.IsBin}} {{$.i18n.Tr "repo.diff.bin"}} - {{else if not $file.IsRenamed}} + {{else}} {{template "repo/diff/stats" dict "file" . "root" $}} {{end}}
@@ -105,23 +103,21 @@
- {{if ne $file.Type 4}} -
- - - {{if $isImage}} - {{template "repo/diff/image_diff" dict "file" . "root" $}} +
+
+ + {{if $isImage}} + {{template "repo/diff/image_diff" dict "file" . "root" $}} + {{else}} + {{if $.IsSplitStyle}} + {{template "repo/diff/section_split" dict "file" . "root" $}} {{else}} - {{if $.IsSplitStyle}} - {{template "repo/diff/section_split" dict "file" . "root" $}} - {{else}} - {{template "repo/diff/section_unified" dict "file" . "root" $}} - {{end}} + {{template "repo/diff/section_unified" dict "file" . "root" $}} {{end}} - -
-
- {{end}} + {{end}} + + +
{{end}}