From 0a5cce85611898b950282971ea06a51c44091d80 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Thu, 24 Sep 2026 07:54:16 +0200 Subject: [PATCH] Add failing repro for Gitea source links on a split SSH/web host (#4641) --- .../app/src/git/forge-url.repro-4641.test.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 packages/app/src/git/forge-url.repro-4641.test.ts diff --git a/packages/app/src/git/forge-url.repro-4641.test.ts b/packages/app/src/git/forge-url.repro-4641.test.ts new file mode 100644 index 0000000000..e15ce4d7d9 --- /dev/null +++ b/packages/app/src/git/forge-url.repro-4641.test.ts @@ -0,0 +1,21 @@ +import { describe, expect, it } from "vitest"; +import { buildForgeBlobUrl, buildForgeBranchTreeUrl } from "./forge-url"; + +// Repro for https://github.com/getpaseo/paseo/issues/4641: a Gitea instance whose +// SSH host (git.example.com) differs from the web URL configured in the tea +// login (https://projects.example.com). The source links must use the web host. +describe("#4641 Gitea source links with a split SSH/web host", () => { + const remoteUrl = "ssh://git@git.example.com:7998/Acme/main.git"; + + it("links the branch tree on the tea login's web host", () => { + expect(buildForgeBranchTreeUrl("gitea", { remoteUrl, branch: "main" })).toBe( + "https://projects.example.com/Acme/main/src/branch/main", + ); + }); + + it("links a file on the tea login's web host", () => { + expect(buildForgeBlobUrl("gitea", { remoteUrl, branch: "main", path: "README.md" })).toBe( + "https://projects.example.com/Acme/main/src/branch/main/README.md", + ); + }); +});