You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/services/gitdiff
silverwind 3b99066aa8
Fix incorrect diff expander for deletion of last lines in a file (#29501)
Fixes: https://github.com/go-gitea/gitea/issues/29498

I don't quite understand this code, but this change does seem to fix the
issue and I tested a number of diffs with it and saw no issue. The
function gets such value if last line is an addition:

```
  LastLeftIdx: (int) 0,
  LastRightIdx: (int) 47,
  LeftIdx: (int) 47,
  RightIdx: (int) 48,
```

If it's a deletion, it gets:

```
  LastLeftIdx: (int) 47,
  LastRightIdx: (int) 0,
  LeftIdx: (int) 48,
  RightIdx: (int) 47,
```

So I think it's correct to make this check respect both left and right
side.
11 months ago
..
testdata/academic-module rm .sample hooks which aren't used (#19101) 3 years ago
csv.go Use Go 1.21 and update dependencies (#26878) 1 year ago
csv_test.go Even more `db.DefaultContext` refactor (#27352) 1 year ago
gitdiff.go Fix incorrect diff expander for deletion of last lines in a file (#29501) 11 months ago
gitdiff_test.go Even more `db.DefaultContext` refactor (#27352) 1 year ago
highlightdiff.go Add option to disable ambiguous unicode characters detection (#28454) 1 year ago
highlightdiff_test.go Implement FSFE REUSE for golang files (#21840) 2 years ago
main_test.go make writing main test easier (#27270) 1 year ago