forgejo/services/pull
Ilya ac0fb36c41 Allow to merge if file path contains " or \ (#8629)
* if a filename in a repository contains " or \ the owner can't merge pull request with this files
because "git diff-tree" adds double quotes to that filepath
example: filepath is ab"cd but "git diff-tree" returns "ab\"cd"

now, when the owner click "Merge Pull Request" button the server returns 500
this commit fix it

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* add -z option to getDiffTree
escape spec symbols for sparse-checkout

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* go fmt

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* typo

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* escape '\'
escape all spaces and '!'

* use regexp.ReplaceAllString()

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* strings.ReplaceAll was added in go 1.12

Signed-off-by: Ilya Pavlov <ilux@cpan.org>

* add '\' to regexp.MustCompile

Signed-off-by: Ilya Pavlov <ilux@cpan.org>
2019-11-01 00:30:02 +00:00
..
commit_status.go If no specific context is required for status check, require an overall success (#8318) 2019-09-30 10:33:40 +08:00
lfs.go Add basic repository lfs management (#7199) 2019-10-28 18:31:55 +00:00
merge.go Allow to merge if file path contains " or \ (#8629) 2019-11-01 00:30:02 +00:00
pull.go Move issue notifications (#8713) 2019-10-29 00:45:43 +08:00
review.go Improve webhooks (#8583) 2019-10-18 23:42:04 +01:00