From be28d3bdc6754a7853d00625fbf5d1367d9b9058 Mon Sep 17 00:00:00 2001 From: msukkari Date: Wed, 17 Sep 2025 12:52:11 -0700 Subject: [PATCH] default to main instead of HEAD when generating file url --- packages/web/src/features/search/searchApi.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/web/src/features/search/searchApi.ts b/packages/web/src/features/search/searchApi.ts index 6d006bbd..d7de91e2 100644 --- a/packages/web/src/features/search/searchApi.ts +++ b/packages/web/src/features/search/searchApi.ts @@ -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 // 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); })();