mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 04:15:30 +00:00
Fix code preview link to use HEAD instead of 'main' (since the main branch might not be named main)
This commit is contained in:
parent
69edcbd3ab
commit
19b36e5813
1 changed files with 2 additions and 2 deletions
|
|
@ -63,11 +63,11 @@ export const getCodeHostFilePreviewLink = (repoName: string, filePath: string):
|
||||||
const info = getRepoCodeHostInfo(repoName);
|
const info = getRepoCodeHostInfo(repoName);
|
||||||
|
|
||||||
if (info?.type === "github") {
|
if (info?.type === "github") {
|
||||||
return `${info.repoLink}/tree/main/${filePath}`;
|
return `${info.repoLink}/blob/HEAD/${filePath}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info?.type === "gitlab") {
|
if (info?.type === "gitlab") {
|
||||||
return `${info.repoLink}/-/blob/main/${filePath}`;
|
return `${info.repoLink}/-/blob/HEAD/${filePath}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue