Fix GitLab hosted source links

This commit is contained in:
Neil
2026-05-30 03:40:10 -07:00
parent af1fc03f41
commit ecfce92aba
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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}`
}