-
-
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
git-upload-pack
strips leading /
only when single-quoted
#12471
Comments
The approach in #12554 would probably help fix this. |
I don't think that will work. That code only deals with |
Fix go-gitea#12471 Signed-off-by: Andrew Thornton <art27@cantab.net>
Fix #12471 Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath I think this PR broke clone via SSH completely... I actually found myself unable to clone anything via SSH on my own server the same day the PR was merged (which coincidentally had master merged in right on this commit), but thought it was my own mistake in configuration. I've just tried on try.gitea.io and got this:
|
🆗 fixed in #12668 |
[x]
):Description
Creating this issue for a friend without github.
This line replaces first ocurrence of
'/
with'
from parameter. This works for cloning the repository withgit
over SSH, as the remote command gets executed asgit-upload-pack '/user/repo'
(strace
shows this clearly). In that case, said function rewrites it togit-upload-pack 'user/repo'
and later on it gets correctly split in user and repo. Now, there are other implementations of Git which doesn't send the commands in that precise way, but as commandgit-upload-pack
with parameter/user/repo
(note no single-quotes). Got is one of such implementations, which can't clone the repo as it fails here.I think the intended behaviour is to remove any leading
/
from the parameter, quoted or not. Most correct solution would be using a shell quoting library to normalize the input and then remove the leading/
. Alternatively, for a quick fix, removing the replace inparseCmd
and changing line 144 to also trim/
should do the trick.The text was updated successfully, but these errors were encountered: