GeezerVison is showing github.com — fix(github): `gh pr new` links the new pull request to the thread (#3… · Pipyakas/t3code@cc842f4
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/source-control-github/src/shared
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/source-control-github/src/shared/definition.test.ts +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -96,6 +96,15 @@ describe("GitHub change request URLs", () => { |
96 | 96 | }); |
97 | 97 | }); |
98 | 98 |
|
| 99 | +describe("GitHub CLI commands", () => { |
| 100 | + it("recognizes shell pull request creates, including gh's `new` alias", () => { |
| 101 | + for (const command of ["gh pr create --fill", "gh pr new --fill"]) { |
| 102 | + expect(definition.changeRequestCreateCommand.test(command), command).toBe(true); |
| 103 | + } |
| 104 | + expect(definition.changeRequestCreateCommand.test("gh pr view 7")).toBe(false); |
| 105 | + }); |
| 106 | +}); |
| 107 | + |
99 | 108 | describe("GitHub repository pages", () => { |
100 | 109 | it("leaves the tree route on other hosts to them", () => { |
101 | 110 | expect( |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/source-control-github/src/shared/definition.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -125,7 +125,8 @@ export const definition = defineSourceControl({ |
125 | 125 | ] as const), |
126 | 126 | checkoutCommand: ({ number }) => `gh pr checkout ${number}`, |
127 | 127 | changeRequestCloseCommand: /\bgh\s+(?:pr\s+(?:merge|close)|stack\s+merge)\b/u, |
128 | | - changeRequestCreateCommand: /\bgh\s+pr\s+create\b/u, |
| 128 | + // `new` is gh's alias for `create`. |
| 129 | + changeRequestCreateCommand: /\bgh\s+pr\s+(?:create|new)\b/u, |
129 | 130 | authorProfileUrl: (login, repositoryUrl) => |
130 | 131 | login.endsWith("[bot]") |
131 | 132 | ? null |
|