The best way to control Claude Code, Codex and more from any computer or phone
fix(github): Enterprise Server pull request URLs can be pasted to check out (#29892)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Alex Southwell committed
Nov 3, 2026 at 23:37 UTC
40aba09b445f00df14eb773ef7d1701fe6fbfbc6
2 files changed
+9
-1
packages/client-runtime/src/pullRequestLinkInput.test.ts
+8
@@ -173,6 +173,14 @@ describe("parsePullRequestReference", () => {
173
expect(parsePullRequestReference(url)).toBe(url);
174
});
175
176
+ it.each([
177
+ "https://github.acme.test/acme/web/pull/42",
178
+ "https://git.corp.example/acme/web/pull/42/files?diff=split",
179
+ ])("accepts GitHub Enterprise Server pull request URL %s", (url) => {
180
+ expect(parsePullRequestReference(url)).toBe(url);
181
+ expect(parsePullRequestReference(`gh pr checkout ${url}`)).toBe(url);
182
+ });
183
+
184
it("accepts gh pr checkout commands with raw numbers", () => {
185
expect(parsePullRequestReference("gh pr checkout 42")).toBe("42");
186
});
packages/source-control-github/src/shared/definition.ts
+1
-1
@@ -19,7 +19,7 @@ import { gitHubReferenceAutolinks } from "./referenceAutolinks.ts";
19
20
const CHECKOUT_COMMAND = /^gh\s+pr\s+checkout\s+(.+)$/i;
21
const CHANGE_REQUEST_REFERENCE =
22
- /^https:\/\/github\.com\/[^/\s]+\/[^/\s]+\/pull\/(\d+)(?:[/?#].*)?$/i;
22
+ /^https?:\/\/[^/?#\s]+\/[^/\s]+\/[^/\s]+\/pull\/(\d+)(?:[/?#].*)?$/i;
23
24
// GitHub Enterprise Server runs on any hostname, so the `<owner>/<repo>/pull/<n>` route alone
25
// identifies a GitHub pull request.