GeezerVison is showing github.com — fix(gitlab): `glab mr accept` counts as a shell merge (#32400) · adampeterhiggins/t3code@a601caa
File tree
Expand file treeCollapse file tree
Open diff view settings
packages/source-control-gitlab/src/shared
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/source-control-gitlab/src/shared/definition.test.ts +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -100,6 +100,15 @@ describe("GitLab change request URLs", () => { |
100 | 100 | }); |
101 | 101 | }); |
102 | 102 |
|
| 103 | +describe("GitLab CLI commands", () => { |
| 104 | + it("recognizes shell merges and closes, including glab's `accept` alias", () => { |
| 105 | + for (const command of ["glab mr merge 7 --yes", "glab mr accept 7 --yes", "glab mr close 7"]) { |
| 106 | + expect(definition.changeRequestCloseCommand.test(command), command).toBe(true); |
| 107 | + } |
| 108 | + expect(definition.changeRequestCloseCommand.test("glab mr view 7")).toBe(false); |
| 109 | + }); |
| 110 | +}); |
| 111 | + |
103 | 112 | describe("GitLab remotes", () => { |
104 | 113 | const recognize = (url: string) => recognizeRemoteWith(definition, url); |
105 | 114 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: packages/source-control-gitlab/src/shared/definition.ts +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -62,7 +62,8 @@ export const definition = defineSourceControl({ |
62 | 62 | "delete-branch", |
63 | 63 | ] as const), |
64 | 64 | checkoutCommand: ({ number }) => `glab mr checkout ${number}`, |
65 | | - changeRequestCloseCommand: /\bglab\s+mr\s+(?:merge|close)\b/u, |
| 65 | + // `accept` is glab's alias for `merge`. |
| 66 | + changeRequestCloseCommand: /\bglab\s+mr\s+(?:merge|accept|close)\b/u, |
66 | 67 | changeRequestCreateCommand: /\bglab\s+mr\s+create\b/u, |
67 | 68 | // Bot users, unlike GitHub's, have real profile pages. |
68 | 69 | authorProfileUrl: (login, repositoryUrl) => |
|