gitea/services
zeripath e6a82047ee
Fix diff skipping lines (#13157)
* Fix diff skipping lines

Backport #13154

ParsePatch previously just skipped all lines that start with "+++ " or "--- "
and makes no attempt to see these lines in context.

This PR rewrites ParsePatch to pay attention to context and position
within a patch, ensuring that --- and +++ are only skipped if
appropriate.

This PR also fixes several issues with incomplete files.

Fix https://codeberg.org/Codeberg/Community/issues/308
Fix #13153

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Add testcase

Signed-off-by: Andrew Thornton <art27@cantab.net>

* fix comment

* simplify error handling

Signed-off-by: Andrew Thornton <art27@cantab.net>

* never return io.EOF

Signed-off-by: Andrew Thornton <art27@cantab.net>
2020-10-16 17:09:25 -04:00
..
comments Refactor pull request review (#8954) 2019-11-14 10:57:36 +08:00
externalaccount Allow externalID to be UUID (#8551) 2019-10-17 10:06:28 +08:00
gitdiff Fix diff skipping lines (#13157) 2020-10-16 17:09:25 -04:00
issue Fix ref links in issue overviews for tags (#8742) 2020-05-14 18:55:43 -04:00
mailer Fix "only mail on mention" bug (#12775) (#12789) 2020-09-10 11:32:54 +03:00
mirror Mirror: Update DB on Address-Update too (#12964) (#12967) 2020-09-28 21:52:13 +02:00
pull Fix error create comment on outdated file (#13041) (#13042) 2020-10-06 14:38:08 +08:00
release Backport to v1.12 for #12341 - Release date fix (#12351) 2020-07-28 14:10:50 -04:00
repository Fix repository create/delete event webhooks (#13008) (#13027) 2020-10-04 17:42:03 -04:00
wiki Handle push rejection in branch and upload (#10854) 2020-03-28 01:13:18 -03:00