From ecfce92ababe48ef91cf770984183d41e5cce0e2 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 30 May 2026 03:40:10 -0700 Subject: [PATCH] Fix GitLab hosted source links --- src/main/git/hosted-remote-url.test.ts | 2 +- src/main/git/hosted-remote-url.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/git/hosted-remote-url.test.ts b/src/main/git/hosted-remote-url.test.ts index 8baff672454..977ea360796 100644 --- a/src/main/git/hosted-remote-url.test.ts +++ b/src/main/git/hosted-remote-url.test.ts @@ -50,7 +50,7 @@ describe('hosted remote URLs', () => { expect( buildHostedRemoteFileUrl('git@gitlab.com:group/sub/repo.git', 'src/a.ts', 'feature/x', 9) - ).toBe('https://gitlab.com/group/sub/repo/tree/feature%2Fx/src/a.ts#L9') + ).toBe('https://gitlab.com/group/sub/repo/-/blob/feature%2Fx/src/a.ts#L9') expect( buildHostedRemoteFileUrl('git@bitbucket.org:team/repo.git', 'src/a.ts', 'feature/x', 7) diff --git a/src/main/git/hosted-remote-url.ts b/src/main/git/hosted-remote-url.ts index 5fd487346e6..84882cc71e0 100644 --- a/src/main/git/hosted-remote-url.ts +++ b/src/main/git/hosted-remote-url.ts @@ -117,7 +117,7 @@ export function buildHostedRemoteFileUrl( return `${baseUrl}/blob/${encodedBranch}${filePathSuffix}#L${line}` } if (remote.provider === 'gitlab') { - return `${baseUrl}/tree/${encodedBranch}${filePathSuffix}#L${line}` + return `${baseUrl}/-/blob/${encodedBranch}${filePathSuffix}#L${line}` } return `${baseUrl}/src/${encodedBranch}${filePathSuffix}#L${line}` }