1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-10-15 06:04:32 -04: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
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
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
task
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