Stop handling mysterious gh: prefix in remote URLs

This commit is contained in:
Katrina Verey
2023-01-06 16:53:52 -05:00
parent 7e6cc7aafb
commit 4821259f01
3 changed files with 6 additions and 10 deletions

View File

@@ -234,10 +234,8 @@ func extractHost(n string) (string, string) {
n, _ = trimPrefixIgnoreCase(n, "git::")
scheme, n := extractScheme(n)
if scheme == "file://" || scheme == "gh:" {
// We support gh: assuming authors use it as a github shorthand, specified in .gitconfig.
if scheme == "file://" {
// The file protocol specifies an absolute path to a local git repo. There is no host.
// In both cases, we return the scheme and the rest of the url.
return scheme, n
}
@@ -264,7 +262,7 @@ func validHostSpecParsed(scheme, username, host string) bool {
}
func extractScheme(s string) (string, string) {
for _, prefix := range []string{"gh:", "ssh://", "https://", "http://", "file://"} {
for _, prefix := range []string{"ssh://", "https://", "http://", "file://"} {
if rest, found := trimPrefixIgnoreCase(s, prefix); found {
return prefix, rest
}