authorgravatar for sabraman@yandex.ruDanila Yudin <sabraman@yandex.ru> 2026-04-05 05:56:26+03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-04-04 19:56:26-07:00
logcd7980b4574a611f9f721d0463755684653b65f2
treef98182946e702af764d7b39da45fa5d96bb085b7
parentf2cd53f232198f597bf492504cab5d9151a5abca
signature Signed by PGP key B5690EEEBB952194

[codex] Canonicalize PR number references (#1749)


2 files changed, 3 insertions(+), 3 deletions(-)

apps/web/src/pullRequestReference.test.ts+2-2
......@@ -14,7 +14,7 @@ describe("parsePullRequestReference", () => {
1414 });
1515
1616 it("accepts #number references", () => {
17 expect(parsePullRequestReference("#42")).toBe("#42");
17 expect(parsePullRequestReference("#42")).toBe("42");
1818 });
1919
2020 it("accepts gh pr checkout commands with raw numbers", () => {
......@@ -22,7 +22,7 @@ describe("parsePullRequestReference", () => {
2222 });
2323
2424 it("accepts gh pr checkout commands with #number references", () => {
25 expect(parsePullRequestReference("gh pr checkout #42")).toBe("#42");
25 expect(parsePullRequestReference("gh pr checkout #42")).toBe("42");
2626 });
2727
2828 it("accepts gh pr checkout commands with GitHub pull request URLs", () => {
apps/web/src/pullRequestReference.ts+1-1
......@@ -22,7 +22,7 @@ export function parsePullRequestReference(input: string): string | null {
2222
2323 const numberMatch = PULL_REQUEST_NUMBER_PATTERN.exec(normalizedInput);
2424 if (numberMatch?.[1]) {
25 return normalizedInput.startsWith("#") ? normalizedInput : numberMatch[1];
25 return numberMatch[1];
2626 }
2727
2828 return null;