X Tutup
Skip to content

Commit 82c6fb7

Browse files
committed
Add a note about the dummy GHE hostname
1 parent c598a1e commit 82c6fb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/cmd/factory/remote_resolver.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,10 @@ func (rr *remoteResolver) Resolver() func() (context.Remotes, error) {
8080
}
8181

8282
if len(cachedRemotes) == 0 {
83+
dummyHostname := "example.com" // any non-github.com hostname is fine here
8384
if config.IsHostEnv(src) {
8485
return nil, fmt.Errorf("none of the git remotes configured for this repository correspond to the %s environment variable. Try adding a matching remote or unsetting the variable.", src)
85-
} else if v, src, _ := cfg.GetWithSource("example.com", "oauth_token"); v != "" && config.IsEnterpriseEnv(src) {
86+
} else if v, src, _ := cfg.GetWithSource(dummyHostname, "oauth_token"); v != "" && config.IsEnterpriseEnv(src) {
8687
return nil, errors.New("set the GH_HOST environment variable to specify which GitHub host to use")
8788
}
8889
return nil, errors.New("none of the git remotes configured for this repository point to a known GitHub host. To tell gh about a new GitHub host, please use `gh auth login`")

0 commit comments

Comments
 (0)
X Tutup