Skip to content

Commit 7a7b8d7

Browse files
apolis-debugclaude
andauthored
fix(forgejo): tea's pull and co aliases count as checkout commands (pingdotgg#32713)
Co-authored-by: apolis-debug <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 6a5d608 commit 7a7b8d7

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ describe("Forgejo CLI commands", () => {
149149
}
150150
expect(definition.changeRequestCloseCommand.test("tea pull checkout 7")).toBe(false);
151151
});
152+
153+
it("reads the change request from every checkout spelling tea accepts", () => {
154+
for (const command of [
155+
"tea pulls checkout 7",
156+
"tea pull checkout 7",
157+
"tea pr co 7",
158+
"tea pull co 7",
159+
]) {
160+
expect(definition.checkoutCommandArgument(command), command).toBe("7");
161+
}
162+
});
152163
});
153164

154165
describe("Forgejo change request host", () => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from "@t3tools/source-control-core/shared/definition";
1717
import { icon } from "./icon.ts";
1818

19-
const CHECKOUT_COMMAND = /^tea\s+(?:pr|pulls)\s+checkout\s+(.+)$/i;
19+
const CHECKOUT_COMMAND = /^tea\s+(?:pr|pulls?)\s+(?:checkout|co)\s+(.+)$/i;
2020
const CHANGE_REQUEST_REFERENCE =
2121
/^https?:\/\/[^/\s]+\/(?:[^/\s]+\/)+[^/\s]+\/pulls\/(\d+)(?:[/?#].*)?$/i;
2222

0 commit comments

Comments
 (0)