-
Notifications
You must be signed in to change notification settings - Fork 244
Description
Hello folks,
By default, Sourcebot indexes the default branch of a repository by actually using the HEAD. This works mostly fine (even though I suspect some errors when the default branch of a repo actually changes, like from master to main, but that's not my concern here :) ).
However, when browsing code and hitting the button "View in {platform}" (GitLab in my case), we then get redirected to a page showing HEAD rather than the default branch. Content is the same but from HEAD we cannot then edit the file to propose a change, we have first to switch to a branch (I'm not sure if this is specific to GitLab or not).
My suggestion (but I'm not sure of the impacts it could have) is that Sourcebot uses the platform metadata to retrieve the default branch name and use it as the Git reference rather than HEAD. Typically, retrieve from the platform that the default branch is main and then use main for indexing, browsing, redirecting...
I hope it makes sense.
I guess (haven't tried yet) that a workaround this is maybe to explicitly list the few usual names of the default branches in my connection config.