Skip to content

Commit a601caa

Browse files
felixlagaclaude
andauthored
fix(gitlab): glab mr accept counts as a shell merge (pingdotgg#32400)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 917ce99 commit a601caa

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎packages/source-control-gitlab/src/shared/definition.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ describe("GitLab change request URLs", () => {
100100
});
101101
});
102102

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+
103112
describe("GitLab remotes", () => {
104113
const recognize = (url: string) => recognizeRemoteWith(definition, url);
105114

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ export const definition = defineSourceControl({
6262
"delete-branch",
6363
] as const),
6464
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,
6667
changeRequestCreateCommand: /\bglab\s+mr\s+create\b/u,
6768
// Bot users, unlike GitHub's, have real profile pages.
6869
authorProfileUrl: (login, repositoryUrl) =>

0 commit comments

Comments
 (0)