Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to merge if file path contains " or \ (#8629) #8772

Merged
merged 1 commit into from Nov 1, 2019

Conversation

@zeripath
Copy link
Contributor

zeripath commented Nov 1, 2019

Backport #8629 on to release/v1.9

  • 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

Please check the following:

  1. Make sure you are targeting the master branch, pull requests on release branches are only allowed for bug fixes.
  2. Read contributing guidelines: https://github.com/go-gitea/gitea/blob/master/CONTRIBUTING.md
  3. Describe what your pull request does and which issue you're targeting (if any)

You MUST delete the content above including this line before posting, otherwise your pull request will be invalid.

* 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>
@zeripath zeripath added the kind/bug label Nov 1, 2019
@lafriks

This comment has been minimized.

Copy link
Member

lafriks commented Nov 1, 2019

I don't think we will release more 1.9 releases if only for critical security issues

@GiteaBot GiteaBot added the lgtm/need 2 label Nov 1, 2019
@zeripath

This comment has been minimized.

Copy link
Contributor Author

zeripath commented Nov 1, 2019

I thought I'd put it out there as a possible pr given we haven't released 1.10 yet.

@GiteaBot GiteaBot added lgtm/need 1 and removed lgtm/need 2 labels Nov 1, 2019
@6543
6543 approved these changes Nov 1, 2019
@GiteaBot GiteaBot added lgtm/done and removed lgtm/need 1 labels Nov 1, 2019
@techknowlogick techknowlogick added this to the 1.9.6 milestone Nov 1, 2019
@techknowlogick techknowlogick merged commit f104898 into go-gitea:release/v1.9 Nov 1, 2019
2 checks passed
2 checks passed
approvals/lgtm this commit looks good
continuous-integration/drone/pr Build is passing
Details
@zeripath zeripath deleted the zeripath:backport-8629-1.9 branch Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.