gogs: Submodule with 'ssh:// method' and alternate port breaks hyperlink in webui

Description

Adding a submodule that uses an alternate port (‘ssh:// method’) causes the hyperlink to the submodule’s git to be broken.

I guess this wouldn’t normally be used (realized I was doing mine wrong) but at the same time, it could be useful in some private environments.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

I would like to get some eyes on the patch I added. https://github.com/gogs/gogs/pull/7383

Thank you for pointing that out, was about to waste alot of time building the whole app

I am not familiar with the go language but this seems fairly trivial:

if (first 3 letters of repo = ssh) then do not include port in URL else include port in url

I’ve just created a submodule link also using ssh (to port 8022). My main project is: ssh://git@git.domain:8022/Docker/Docker.git my submodule is

[submodule "openhab/conf"]
url = ssh://git@git.8022/HomeAutomation/OpenHAB.git

In the web UI of Gogs the link for the conf folder in the openhab directory is for https://git.domain/8022/HomeAutomation/OpenHAB/commit/f49efa46370da23ec34055d568a6b8401755516a

So it’s taken the :8022 port and made a folder as part of the link.