Skip to content

Commit 22b89ef

Browse files
MarcoDotIOclaude
andauthored
fix(server): Forgejo and GitCafe pull requests link to their threads again (pingdotgg#22937)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 1b22228 commit 22b89ef

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎apps/server/src/git/GitManager.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,6 +1785,11 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
17851785
"gitlab.example.com/group/subgroup/repository",
17861786
],
17871787
["https://bitbucket.org/team/repository/pull-requests/42", "bitbucket.org/team/repository"],
1788+
["https://codeberg.org/team/repository/pulls/42", "codeberg.org/team/repository"],
1789+
[
1790+
"http://code.example:3000/forgejo/team/repository/pulls/42/files",
1791+
"code.example/forgejo/team/repository",
1792+
],
17881793
[
17891794
"https://dev.azure.com/org/project/_git/repository/pullrequest/42",
17901795
"dev.azure.com/org/project/_git/repository",

‎apps/server/src/git/GitManager.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export function pullRequestRepositoryKey(value: string): string | null {
260260
try {
261261
const url = new URL(value);
262262
const match =
263-
/^(.*)(?:\/pull\/|\/-\/merge_requests\/|\/pull-requests\/|\/pullrequest\/)\d+(?:\/.*)?$/iu.exec(
263+
/^(.*)(?:\/pulls?\/|\/-\/merge_requests\/|\/pull-requests\/|\/pullrequest\/)\d+(?:\/.*)?$/iu.exec(
264264
url.pathname,
265265
);
266266
if (match?.[1] === undefined) return null;

0 commit comments

Comments
 (0)