You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zeripath 3d8b5ad5f3
Fix a couple of CommentAsPatch issues. (#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

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

* 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

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

* 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>
3 years ago
..
check.go migrate from com.* to alternatives (#14103) 4 years ago
check_test.go migrate from com.* to alternatives (#14103) 4 years ago
commit_status.go [Refactor] CombinedStatus and CommitStatus related functions & structs (#14026) 4 years ago
lfs.go Add basic repository lfs management (#7199) 5 years ago
main_test.go Move some pull request functions from models to services (#9266) 5 years ago
merge.go Standardize Co-Authored-By / Reviewed-By strings (#14097) 4 years ago
patch.go [Enhancement] Allow admin to merge pr with protected file changes (#12078) 4 years ago
pull.go [API] Add pagination to ListBranches (#14524) 3 years ago
pull_test.go Move PushToBaseRepo from models to services/pull (#9352) 5 years ago
review.go Fix a couple of CommentAsPatch issues. (#14804) 3 years ago
temp_repo.go Handle more pathological branch and tag names (#11843) 4 years ago
update.go Check Push permissions on IsUserAllowedToUpdate (#11448) 4 years ago