Repo inference uses the SSH host as the API host #342
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With a Fjord forge remote like
ssh://git@ssh.commons.fjord.host/skyview-ptsa/site.git,fj pr listsends its API request tohttps://ssh.commons.fjord.host/api/v1/.... That host serves git over SSH only, so the request fails witherror: sending HTTP request.Passing
--host commons.fjord.hostdoesn't help.git::remote::discovercompares the preferred host with the parsed remote host (ssh.commons.fjord.host), finds no match, and reportsrepository not specified and could not be inferred from git remote. The only workaround is--hostplus-R.Cause
parse_remotereturns the git transport host asRemoteRepo.host, and callers treat it as the web/API host. On Fjord forges the SSH endpoint lives on a separatessh.<forge>name (portless git SSH), so the two hosts differ.Fix
When the remote uses an SSH transport (an
ssh://URL or the scp form) and its host starts withssh., resolve the API host to the parent name. Anhttps://ssh.example/...remote is a real web host and stays as it is. The--hostmatch indiscoverthen works too, because both sides compare the web host.Tests for both URL forms, the https case, and
discoverwith a preferred host.