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", () => {...@@ -14,7 +14,7 @@ describe("parsePullRequestReference", () => {
14 });14 });
1515
16 it("accepts #number references", () => {16 it("accepts #number references", () => {
17 expect(parsePullRequestReference("#42")).toBe("#42");17 expect(parsePullRequestReference("#42")).toBe("42");
18 });18 });
1919
20 it("accepts gh pr checkout commands with raw numbers", () => {20 it("accepts gh pr checkout commands with raw numbers", () => {
...@@ -22,7 +22,7 @@ describe("parsePullRequestReference", () => {...@@ -22,7 +22,7 @@ describe("parsePullRequestReference", () => {
22 });22 });
2323
24 it("accepts gh pr checkout commands with #number references", () => {24 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");
26 });26 });
2727
28 it("accepts gh pr checkout commands with GitHub pull request URLs", () => {28 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 {...@@ -22,7 +22,7 @@ export function parsePullRequestReference(input: string): string | null {
2222
23 const numberMatch = PULL_REQUEST_NUMBER_PATTERN.exec(normalizedInput);23 const numberMatch = PULL_REQUEST_NUMBER_PATTERN.exec(normalizedInput);
24 if (numberMatch?.[1]) {24 if (numberMatch?.[1]) {
25 return normalizedInput.startsWith("#") ? normalizedInput : numberMatch[1];25 return numberMatch[1];
26 }26 }
2727
28 return null;28 return null;