Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

Commit b943823

Browse files
committed
fix: resolve link URL instead of string concatenation
1 parent 15afe14 commit b943823

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/blame.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ const getDecorationFromHunk = (hunk: Hunk, now: number, decoratedLine: number):
2020
addSuffix: true,
2121
})}: • ${truncate(hunk.message, 45)}`,
2222
hoverMessage: `${truncate(hunk.message, 1000)}`,
23-
linkURL: `${
24-
sourcegraph.internal.clientApplication === 'sourcegraph' ? '' : sourcegraph.internal.sourcegraphURL
25-
}${hunk.commit.url}`,
23+
linkURL: new URL(
24+
hunk.commit.url,
25+
sourcegraph.internal.clientApplication === 'sourcegraph'
26+
? undefined
27+
: sourcegraph.internal.sourcegraphURL.toString()
28+
).href,
2629
},
2730
})
2831

0 commit comments

Comments
 (0)