The best way to control Claude Code, Codex and more from any computer or phone
fix(gitlab): `glab mr accept` counts as a shell merge (#32400)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Felix Laga committed
Nov 7, 2026 at 21:40 UTC
a601caaffd45ba7527bf2e8dcb1e8b966c70fa92
2 files changed
+11
-1
packages/source-control-gitlab/src/shared/definition.test.ts
+9
@@ -100,6 +100,15 @@ describe("GitLab change request URLs", () => {
100
});
101
});
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
+
112
describe("GitLab remotes", () => {
113
const recognize = (url: string) => recognizeRemoteWith(definition, url);
114
packages/source-control-gitlab/src/shared/definition.ts
+2
-1
@@ -62,7 +62,8 @@ export const definition = defineSourceControl({
62
"delete-branch",
63
] as const),
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,
67
changeRequestCreateCommand: /\bglab\s+mr\s+create\b/u,
68
// Bot users, unlike GitHub's, have real profile pages.
69
authorProfileUrl: (login, repositoryUrl) =>