Commit 38f288e
Allow to merge if file path contains " or \ (go-gitea#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 <[email protected]>
* add -z option to getDiffTree
escape spec symbols for sparse-checkout
Signed-off-by: Ilya Pavlov <[email protected]>
* go fmt
Signed-off-by: Ilya Pavlov <[email protected]>
* typo
Signed-off-by: Ilya Pavlov <[email protected]>
* escape '\'
escape all spaces and '!'
* use regexp.ReplaceAllString()
Signed-off-by: Ilya Pavlov <[email protected]>
* strings.ReplaceAll was added in go 1.12
Signed-off-by: Ilya Pavlov <[email protected]>
* add '\' to regexp.MustCompile
Signed-off-by: Ilya Pavlov <[email protected]>1 parent 3341aaf commit 38f288e
1 file changed
+24
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
328 | 329 | | |
329 | 330 | | |
330 | 331 | | |
| 332 | + | |
| 333 | + | |
331 | 334 | | |
332 | 335 | | |
333 | 336 | | |
334 | 337 | | |
335 | | - | |
| 338 | + | |
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
339 | 342 | | |
340 | 343 | | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
341 | 357 | | |
342 | 358 | | |
343 | 359 | | |
| |||
346 | 362 | | |
347 | 363 | | |
348 | 364 | | |
| 365 | + | |
349 | 366 | | |
350 | | - | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
351 | 372 | | |
| 373 | + | |
352 | 374 | | |
353 | 375 | | |
0 commit comments