From 46082a966af94b6429628175eea72faff46428e3 Mon Sep 17 00:00:00 2001 From: bkellam Date: Tue, 3 Feb 2026 09:28:48 -0800 Subject: [PATCH 1/2] fix --- packages/web/src/lib/utils.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/web/src/lib/utils.ts b/packages/web/src/lib/utils.ts index 4180b0a9d..1ce5707b4 100644 --- a/packages/web/src/lib/utils.ts +++ b/packages/web/src/lib/utils.ts @@ -343,7 +343,7 @@ export const getCodeHostCommitUrl = ({ export const getCodeHostBrowseAtBranchUrl = ({ webUrl, codeHostType, - branchName, + branchName: _branchName, }: { webUrl?: string | null, codeHostType: CodeHostType, @@ -353,6 +353,8 @@ export const getCodeHostBrowseAtBranchUrl = ({ return undefined; } + const branchName = _branchName.replace(/^refs\/(heads|tags)\//, ''); + switch (codeHostType) { case 'github': return `${webUrl}/tree/${branchName}`; @@ -376,7 +378,7 @@ export const getCodeHostBrowseAtBranchUrl = ({ export const getCodeHostBrowseFileAtBranchUrl = ({ webUrl, codeHostType, - branchName, + branchName: _branchName, filePath, }: { webUrl?: string | null, @@ -388,6 +390,8 @@ export const getCodeHostBrowseFileAtBranchUrl = ({ return undefined; } + const branchName = _branchName.replace(/^refs\/(heads|tags)\//, ''); + switch (codeHostType) { case 'github': return `${webUrl}/blob/${branchName}/${filePath}`; From 0342ad4e07786d097252144f645539b177f5f29c Mon Sep 17 00:00:00 2001 From: bkellam Date: Tue, 3 Feb 2026 10:42:08 -0800 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4109c96b4..98e8db874 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Fixed issue where opening GitLab file links would result in a 404. [#846](https://github.com/sourcebot-dev/sourcebot/pull/846) + ## [4.10.24] - 2026-02-03 ### Fixed