GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(github): Enterprise Server pull request URLs can be pasted to che… · incognitojam/styal@40aba09

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • client-runtime/src
      • pullRequestLinkInput.test.ts
    • source-control-github/src/shared
      • definition.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/client-runtime/src/pullRequestLinkInput.test.ts‎

Copy file name to clipboardExpand all lines: packages/client-runtime/src/pullRequestLinkInput.test.ts
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ describe("parsePullRequestReference", () => {
173173
expect(parsePullRequestReference(url)).toBe(url);
174174
});
175175

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+
176184
it("accepts gh pr checkout commands with raw numbers", () => {
177185
expect(parsePullRequestReference("gh pr checkout 42")).toBe("42");
178186
});
Collapse file

‎packages/source-control-github/src/shared/definition.ts‎

Copy file name to clipboardExpand all lines: packages/source-control-github/src/shared/definition.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { gitHubReferenceAutolinks } from "./referenceAutolinks.ts";
1919

2020
const CHECKOUT_COMMAND = /^gh\s+pr\s+checkout\s+(.+)$/i;
2121
const CHANGE_REQUEST_REFERENCE =
22-
/^https:\/\/github\.com\/[^/\s]+\/[^/\s]+\/pull\/(\d+)(?:[/?#].*)?$/i;
22+
/^https?:\/\/[^/?#\s]+\/[^/\s]+\/[^/\s]+\/pull\/(\d+)(?:[/?#].*)?$/i;
2323

2424
// GitHub Enterprise Server runs on any hostname, so the `<owner>/<repo>/pull/<n>` route alone
2525
// identifies a GitHub pull request.

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.