1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-26 09:09:36 -05:00
forgejo/services
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
..
comments Move webhook codes from service to webhook notification (#8712) 2019-10-30 12:02:46 +02:00
externalaccount Allow externalID to be UUID (#8551) 2019-10-17 10:06:28 +08:00
gitdiff Move git diff codes from models to services/gitdiff (#7889) 2019-09-05 22:20:09 -04:00
issue Move issue change content from models to service (#8711) 2019-10-30 10:36:25 +02:00
mailer Mail assignee when issue/pull request is assigned (#8546) 2019-10-25 22:46:37 +08:00
milestone move some milestone functions to a standalone package (#8213) 2019-09-18 08:17:12 +08:00
mirror Move sync mirror actions to mirror service package (#8518) 2019-10-16 10:56:59 +01:00
pull Allow to merge if file path contains " or \ (#8629) 2019-11-01 00:30:02 +00:00
release Move mirror to a standalone package from models (#7486) 2019-10-01 21:40:17 +08:00
repository Move some repositories' operations to a standalone service package (#8557) 2019-10-26 14:54:11 +08:00