-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Incorrect link for submodules that specify the remote port #2775
Incorrect link for submodules that specify the remote port #2775
Comments
This one (superficially) seems to be pretty simple. If anyone can point me to the right direction I could solve it myself. |
The culprit should be this function here: https://github.com/go-gitea/git/blob/master/submodule.go#L32-L74 Have fun! If you need any help, come on #develop on the Discord server or #gitea-dev on Freenode :) |
Fixes go-gitea/gitea#2775 Signed-off-by: Fernando Governatore <[email protected]>
If the repo's host is in urlPrefix, test if there is a number after the ":" and, if there is one, consider it as a port number and ignore it in the URL returned. Fixes go-gitea/gitea#2775 Signed-off-by: Fernando Governatore <[email protected]>
If the repo's host is in urlPrefix, test if there is a number after the ":" and, if there is one, consider it as a port number and ignore it in the URL returned. Fixes go-gitea/gitea#2775 Signed-off-by: Fernando Governatore <[email protected]>
Hi, Is this fix on the Docker image already? I've tested commit "da1edbf" here and it doesn't seems to solve the problem. Is there anything I should do to "update" the links? |
This has been merged to latest Docker image I think. |
The problem persists. The submodule link shows The workaround I'm using is to set a relative path on the submodule URL. Fortunately, the workaround is the correct way of doing things 👍, but older revisions still have the wrong link. |
Hi Governa, could you upload another testcase to try, so I can check this out? |
@Governa is the link to the come_on submodule in https://try.gitea.io/arandomer/arepoopo an example of this? https://try.gitea.io/22/arandomer/come_on which should be https://try.gitea.io/arandomer/come_on generated from Now looking at: gitea/modules/git/submodule.go Lines 32 to 77 in f6eedd4
I'm not particularly fond of this code - Why aren't we using the default url parsing code built into go? Strangely it seems like a similiar case is being tested for in: gitea/modules/git/submodule_test.go Line 23 in f6eedd4
|
I think |
yep it isn't - just tested it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions. |
The one case I had bookmarked is now working, so works for me 👍 |
This has since been fixed and included in testcases |
d4c9399 and any older one that I've tested
[x]
):https://try.gitea.io/BugReproduction871239/test213
Description
In the example URL, there is a submodule called test214 that uses the port (22) as user name in its link.
The submodule configuration is valid and works on the command line.
The text was updated successfully, but these errors were encountered: