fix: normalize ssh.github.com to github.com for URL generation

When using GitHub's SSH-over-HTTPS gateway (ssh.github.com),
the remote URL is returned as ssh://git@ssh.github.com/..., causing
git-open to generate invalid URLs like https://ssh.github.com/...

This fix normalizes the domain back to github.com so that the
generated browser URL is always valid.
This commit is contained in:
wu wenbin 2026-03-24 15:24:04 +08:00
parent 41ebfcebe1
commit 1b563d8a69
No known key found for this signature in database
GPG key ID: F957E18D6571E699

View file

@ -157,6 +157,11 @@ else
fi
fi
# Normalize GitHub's SSH gateway hostname back to github.com for URL generation.
# ssh.github.com is used when connecting via SSH over port 443 (GitHub's SSH-over-HTTPS gateway),
# but the generated URL should still point to github.com.
domain=${domain//ssh\.github\.com/github.com}
# Trim "/" from beginning of URL; "/" and ".git" from end of URL
urlpath=${urlpath#/} urlpath=${urlpath%/} urlpath=${urlpath%.git}