forgejo/services
silverwind 85bf170ff0
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.

(cherry picked from commit 3b99066aa866e51e6a610716eaddfd1ea3645a67)
2024-03-06 12:10:45 +08:00
..
actions Fix workflow trigger event bugs (#29467) 2024-03-06 12:10:44 +08:00
agit Use the database object format name but not read from git repoisitory everytime and fix possible migration wrong objectformat when migrating a sha256 repository (#29294) 2024-02-26 22:30:26 +01:00
asymkey Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
attachment Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
auth Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
automerge Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
context Let ctx.FormOptionalBool() return optional.Option[bool] (#29461) 2024-03-06 12:10:43 +08:00
contexttest Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
convert Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
cron Refactor locale&string&template related code (#29165) 2024-02-16 15:20:52 +01:00
doctor [GITEA] new doctor check: fix-push-mirrors-without-git-remote (#1853) 2024-02-05 16:09:41 +01:00
externalaccount Final round of db.DefaultContext refactor (#27587) 2023-10-14 08:37:24 +00:00
feed More db.DefaultContext refactor (#27265) 2023-09-29 12:12:54 +00:00
forgejo [UPGRADE] run sanity checks before the database is upgraded 2024-02-05 14:44:33 +01:00
forms Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
gitdiff Fix incorrect diff expander for deletion of last lines in a file (#29501) 2024-03-06 12:10:45 +08:00
indexer Fix missing issue search index update when changing status (#28325) 2023-12-03 12:22:44 +01:00
issue Allow non-admin users to delete review requests (#29057) 2024-02-26 22:30:27 +01:00
lfs Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
mailer Rename Str2html to SanitizeHTML and clarify its behavior (followup) 2024-03-06 12:10:45 +08:00
markup Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
migrations Include resource state events in Gitlab downloads (followup) 2024-03-06 12:10:43 +08:00
mirror Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
notify [GITEA] notifies admins on new user registration 2024-02-05 16:09:28 +01:00
org Delete repos of org when purge delete user (#27273) 2023-10-19 13:16:11 +00:00
packages Port "Use general token signing secret" 2024-02-19 20:49:37 +01:00
pull Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
release Use the database object format name but not read from git repoisitory everytime and fix possible migration wrong objectformat when migrating a sha256 repository (#29294) 2024-02-26 22:30:26 +01:00
repository Move generate from module to service (#29465) 2024-03-06 12:10:44 +08:00
secrets Refactor deletion (#28610) 2023-12-25 21:25:29 +01:00
task Fix incorrect ctx usage in defer function (#27740) 2023-10-22 14:12:27 +00:00
uinotification Penultimate round of db.DefaultContext refactor (#27414) 2023-10-11 04:24:07 +00:00
user Remove unused KeyID. (#29167) 2024-02-16 15:20:52 +01:00
webhook Merge branch 'rebase-forgejo-dependency' into wip-forgejo 2024-02-05 18:58:23 +01:00
wiki [GITEA] Allow changing the repo Wiki branch to main 2024-02-05 16:57:47 +01:00