Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 6 additions & 2 deletions packages/web/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export const getCodeHostCommitUrl = ({
export const getCodeHostBrowseAtBranchUrl = ({
webUrl,
codeHostType,
branchName,
branchName: _branchName,
}: {
webUrl?: string | null,
codeHostType: CodeHostType,
Expand All @@ -353,6 +353,8 @@ export const getCodeHostBrowseAtBranchUrl = ({
return undefined;
}

const branchName = _branchName.replace(/^refs\/(heads|tags)\//, '');

switch (codeHostType) {
case 'github':
return `${webUrl}/tree/${branchName}`;
Expand All @@ -376,7 +378,7 @@ export const getCodeHostBrowseAtBranchUrl = ({
export const getCodeHostBrowseFileAtBranchUrl = ({
webUrl,
codeHostType,
branchName,
branchName: _branchName,
filePath,
}: {
webUrl?: string | null,
Expand All @@ -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}`;
Expand Down