]> source.dussan.org Git - gitea.git/commit
Allow to merge if file path contains " or \ (#8629)
authorIlya <ilux@cpan.org>
Fri, 1 Nov 2019 00:30:02 +0000 (03:30 +0300)
committerzeripath <art27@cantab.net>
Fri, 1 Nov 2019 00:30:02 +0000 (00:30 +0000)
commitac0fb36c417376f3967d0d98ae5066d8946c41c9
tree8c9416a9961aaa7cd51cba5a6e3154c81ada1073
parent4ee986e4c909641ce020f58f6803aed8b1559fcb
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>
services/pull/merge.go