@devries-cameron20 / t3code Mirror · read-only / commits / 93d0e1a8e6
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 04:15 UTC

fix(shared): detect *.ghe.com remotes as GitHub (#19362)

Torjus Bjåen committed Oct 18, 2026 at 21:18 UTC 93d0e1a8e6b7d69ea84ffe6b216dd3dc998fb161
2 files changed +18 -1
packages/shared/src/sourceControl.test.ts
+16
@@ -147,6 +147,22 @@ describe("detectSourceControlProviderFromRemoteUrl", () => {
147 ).toBe("bitbucket");
148 });
149
150 + it("detects GitHub Enterprise Cloud data residency hosts on ghe.com", () => {
151 + expect(detectSourceControlProviderFromRemoteUrl("https://acme.ghe.com/owner/repo.git")).toEqual(
152 + {
153 + kind: "github",
154 + name: "GitHub Self-Hosted",
155 + baseUrl: "https://acme.ghe.com",
156 + },
157 + );
158 + expect(detectSourceControlProviderFromRemoteUrl("git@acme.ghe.com:owner/repo.git")?.kind).toBe(
159 + "github",
160 + );
161 + expect(detectSourceControlProviderFromRemoteUrl("https://ghe.com/owner/repo.git")?.kind).toBe(
162 + "unknown",
163 + );
164 + });
165 +
166 it("does not match provider names embedded in unrelated DNS labels", () => {
167 expect(
168 detectSourceControlProviderFromRemoteUrl("https://notgithub.example.com/owner/repo.git")
packages/shared/src/sourceControl.ts
+2 -1
@@ -179,8 +179,9 @@ function hasDnsLabel(host: string, label: string): boolean {
179 return host.split(".").includes(label);
180 }
181
182 +/** `*.ghe.com` is GitHub Enterprise Cloud with data residency, one subdomain per enterprise. */
183 function isGitHubHost(host: string): boolean {
183 - return host === "github.com" || hasDnsLabel(host, "github");
184 + return host === "github.com" || host.endsWith(".ghe.com") || hasDnsLabel(host, "github");
185 }
186
187 function isGitLabHost(host: string): boolean {