[codex] Canonicalize PR number references (#1749)

This commit is contained in:
Danila Yudin authored and GitHub committed 2026-04-04 19:56:26 -07:00
1 parent f2cd53f232
commit cd7980b457
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -14,7 +14,7 @@ describe("parsePullRequestReference", () => {
});
it("accepts #number references", () => {
expect(parsePullRequestReference("#42")).toBe("#42");
expect(parsePullRequestReference("#42")).toBe("42");
});
it("accepts gh pr checkout commands with raw numbers", () => {
@@ -22,7 +22,7 @@ describe("parsePullRequestReference", () => {
});
it("accepts gh pr checkout commands with #number references", () => {
expect(parsePullRequestReference("gh pr checkout #42")).toBe("#42");
expect(parsePullRequestReference("gh pr checkout #42")).toBe("42");
});
it("accepts gh pr checkout commands with GitHub pull request URLs", () => {
+1 -1
View File
@@ -22,7 +22,7 @@ export function parsePullRequestReference(input: string): string | null {
const numberMatch = PULL_REQUEST_NUMBER_PATTERN.exec(normalizedInput);
if (numberMatch?.[1]) {
return normalizedInput.startsWith("#") ? normalizedInput : numberMatch[1];
return numberMatch[1];
}
return null;