1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-12-04 14:46:57 -05:00
gitea/services
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.
2024-03-01 16:12:21 +00:00
..
actions Fix workflow trigger event bugs (#29467) 2024-02-28 15:35:04 +00: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-24 06:55:19 +00: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-02-27 08:12:22 +01:00
auth Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
automerge Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
context Use a predictiable fork URL to allow forking repositories without providing a repo ID (#29519) 2024-03-01 12:52:30 +00:00
contexttest Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
convert Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
cron Refactor locale&string&template related code (#29165) 2024-02-14 21:48:45 +00:00
doctor Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
externalaccount Revert "Support SAML authentication (#25165)" (#29358) 2024-02-24 12:18:49 +08:00
feed
forms Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
gitdiff Fix incorrect diff expander for deletion of last lines in a file (#29501) 2024-03-01 16:12:21 +00: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-24 12:38:43 +00:00
lfs Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
mailer Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
markup Move context from modules to services (#29440) 2024-02-27 08:12:22 +01:00
migrations Move migration functions to services layer (#29497) 2024-03-01 02:23:00 +00:00
mirror Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
notify
org Delete repos of org when purge delete user (#27273) 2023-10-19 13:16:11 +00:00
packages Integrate alpine noarch packages into other architectures index (#29137) 2024-02-25 15:10:55 +00:00
pull Move context from modules to services (#29440) 2024-02-27 08:12:22 +01: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-24 06:55:19 +00:00
repository Move migration functions to services layer (#29497) 2024-03-01 02:23:00 +00: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
user Unify password changing and invalidate auth tokens (#27625) 2024-02-04 14:05:26 +00:00
webhook Use crypto/sha256 (#29386) 2024-02-25 13:32:13 +00:00
wiki Fix an actions schedule bug (#28942) 2024-01-31 14:55:12 +00:00