1
1
mirror of https://github.com/go-gitea/gitea synced 2024-09-15 16:26:07 +00:00
gitea/services/pull
zeripath be25afc6de
Fix a couple of CommentAsPatch issues. (#14804) (#14820)
Backport #14804

* CutDiffAroundLine makes the incorrect assumption that `---` and `+++` always represent part of the header of a diff.

This PR adds a flag to its parsing to prevent this problem and adds a streaming parsing technique to CutDiffAroundLine using an io.pipe instead of just sending data to an unbounded buffer.

Fix #14711

* Handle unquoted comment patch files

When making comment patches unfortunately the patch does not always quote the filename
This makes the diff --git header ambiguous again.

This PR finally adds handling for ambiguity in to parse patch

Fix #14812

* Add in testing for no error

There is no way currently for CutDiffAroundLine in this test to cause an
error however, it should still be tested.

Signed-off-by: Andrew Thornton <art27@cantab.net>
2021-02-28 15:19:51 +02:00
..
check_test.go Only check for conflicts/merging if the PR has not been merged in the interim (#10132) 2020-02-10 01:09:31 +02:00
check.go [Enhancement] Allow admin to merge pr with protected file changes (#12078) 2020-10-13 14:50:57 -04:00
commit_status.go Fix bug on pull view when required status check no ci result (#10648) 2020-03-07 07:33:20 +00:00
lfs.go Add basic repository lfs management (#7199) 2019-10-28 18:31:55 +00:00
main_test.go Move some pull request functions from models to services (#9266) 2019-12-06 21:44:10 -05:00
merge.go Fix Pull Merge when tag with same name as base branch exist (#13882) (#13896) 2020-12-08 12:58:44 +01:00
patch.go [Enhancement] Allow admin to merge pr with protected file changes (#12078) 2020-10-13 14:50:57 -04:00
pull_test.go Move PushToBaseRepo from models to services/pull (#9352) 2019-12-15 04:28:51 +01:00
pull.go Send notifications for mentions in pulls, issues, (code-)comments (#14218) (#14221) 2021-01-03 15:44:40 +02:00
review.go Fix a couple of CommentAsPatch issues. (#14804) (#14820) 2021-02-28 15:19:51 +02:00
temp_repo.go Handle more pathological branch and tag names (#11843) 2020-06-11 19:49:47 -04:00
update.go Check Push permissions on IsUserAllowedToUpdate (#11448) 2020-05-16 20:48:30 -04:00