mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-15 05:45:20 +00:00
default to main instead of HEAD when generating file url
This commit is contained in:
parent
521b316d38
commit
be28d3bdc6
1 changed files with 2 additions and 1 deletions
|
|
@ -227,7 +227,8 @@ export const search = async ({ query, matches, contextLines, whole }: SearchRequ
|
||||||
|
|
||||||
// If there are multiple branches pointing to the same revision of this file, it doesn't
|
// If there are multiple branches pointing to the same revision of this file, it doesn't
|
||||||
// matter which branch we use here, so use the first one.
|
// matter which branch we use here, so use the first one.
|
||||||
const branch = file.Branches && file.Branches.length > 0 ? file.Branches[0] : "HEAD";
|
// @note: bitbucket and ado don't support using HEAD for the branch in links, so we default to main here
|
||||||
|
const branch = file.Branches && file.Branches.length > 0 ? file.Branches[0] : "main";
|
||||||
return getFileWebUrl(template, branch, file.FileName);
|
return getFileWebUrl(template, branch, file.FileName);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue