-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
404 On Pull Request when branch has plus character #6333
Comments
See #6302 - I've listed a number of ways that the compare url is broken. That being said rather than mark this issue as a duplicate - We could use this issue as the sub issue for dealing with url decomposition and creation affecting compare. (There's several subissues to #6302 - including the actual issue that causes it which as yet is unidentified.) |
It looks like this problem comes from: Line 636 in 7884353
QueryUnescape will turn a literal + into a blank space. Heres a test: I think we might want PathUnescape here:
|
Currently branch names with a '+' fail in certain situations because QueryUnescape replaces the + character with a blank space. Using PathUnescape should be better since it is defined as: // PathUnescape is identical to QueryUnescape except that it does not // unescape '+' to ' ' (space). Fixes go-gitea#6333
If this is duplicated with #6302 , I think we can close this one. |
This issue is separate and has a specific known cause (which will be fixed with PR #6334) |
…6334) * Use PathUnescape instead of QueryUnescape when working with branch names Currently branch names with a '+' fail in certain situations because QueryUnescape replaces the + character with a blank space. Using PathUnescape should be better since it is defined as: // PathUnescape is identical to QueryUnescape except that it does not // unescape '+' to ' ' (space). Fixes #6333 * Change error to match new function name * Add new util function PathEscapeSegments This function simply runs PathEscape on each segment of a path without touching the forward slash itself. We want to use this instead of PathEscape/QueryEscape in most cases because a forward slash is a valid name for a branch etc... and we don't want that escaped in a URL. Putting this in new file url.go and also moving a couple similar functions into that file as well. * Use EscapePathSegments where appropriate Replace various uses of EscapePath/EscapeQuery with new EscapePathSegments. Also remove uncessary uses of various escape/unescape functions when the text had already been escaped or was not escaped. * Reformat comment to make drone build happy * Remove no longer used url library * Requested code changes
[x]
):https://try.gitea.io/TestGanization/testando/compare/master...willsk:test++
Description
If you have a branch with a plus sign in it (haven't tried other characters) which is legal in git (my client in Fedora didn't complain -- a colleague had a branch with 'c++' in the name), you can't make a pull request: as soon as you select the branch with the + in the name you get a 404.
...
Screenshots
--> (click on test++)
The text was updated successfully, but these errors were encountered: