summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-08-30 16:43:06 +0100
committerGitHub <noreply@github.com>2021-08-30 16:43:06 +0100
commit58f4a4114eb53cff9da13923ea95edd22a904840 (patch)
tree4278846413675758fd8fc5e11f09cdee478c4b02 /modules
parentb31307c41c94564762d3485671da6c975a8deeb8 (diff)
downloadgitea-58f4a4114eb53cff9da13923ea95edd22a904840.tar.gz
gitea-58f4a4114eb53cff9da13923ea95edd22a904840.zip
Simplify split diff view generation and remove JS dependency (#16775) (#16863)
Backport #16775 Gitea has relied on some slow JS code to match up added and deleted lines on the diff pages. This can cause a considerable slow down on large diff pages. This PR makes a small change meaning that the matching up can occur much more simply. Partial fix #1351 Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'modules')
-rw-r--r--modules/repofiles/diff_test.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/repofiles/diff_test.go b/modules/repofiles/diff_test.go
index d40f8a50fe..da50284150 100644
--- a/modules/repofiles/diff_test.go
+++ b/modules/repofiles/diff_test.go
@@ -83,6 +83,7 @@ func TestGetDiffPreview(t *testing.T) {
{
LeftIdx: 3,
RightIdx: 0,
+ Match: 4,
Type: 3,
Content: "-Description for repo1",
Comments: nil,
@@ -90,6 +91,7 @@ func TestGetDiffPreview(t *testing.T) {
{
LeftIdx: 0,
RightIdx: 3,
+ Match: 3,
Type: 2,
Content: "+Description for repo1",
Comments: nil,
@@ -97,6 +99,7 @@ func TestGetDiffPreview(t *testing.T) {
{
LeftIdx: 0,
RightIdx: 4,
+ Match: -1,
Type: 2,
Content: "+this is a new line",
Comments: nil,