Skip to content

Commit be28d3b

Browse files
committed
default to main instead of HEAD when generating file url
1 parent 521b316 commit be28d3b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

packages/web/src/features/search/searchApi.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ export const search = async ({ query, matches, contextLines, whole }: SearchRequ
227227

228228
// If there are multiple branches pointing to the same revision of this file, it doesn't
229229
// matter which branch we use here, so use the first one.
230-
const branch = file.Branches && file.Branches.length > 0 ? file.Branches[0] : "HEAD";
230+
// @note: bitbucket and ado don't support using HEAD for the branch in links, so we default to main here
231+
const branch = file.Branches && file.Branches.length > 0 ? file.Branches[0] : "main";
231232
return getFileWebUrl(template, branch, file.FileName);
232233
})();
233234

0 commit comments

Comments
 (0)