In VSCode Extension, Open File in Sourcegraph Web shows a 404 if current branch does not exist and defaultBranch is set
Created by: wukkuan
- Sourcegraph version: Sourcegraph.com (affects all versions)
- Platform information: macOS, vscode extension 2.2.3
Steps to reproduce:
- Install sourcegraph vscode extension
- Set
sourcegraph.defaultBranch
tomaster
in vscode settings - Clone https://github.com/wukkuan/sourcegraph-test
- Check out a new branch that doesn't exist (name doesn't matter, but let's go with
test
) - Open the cloned repository in vscode
- Open the README.md file
- Right click in the file, click Open file in sourcegraph web
Expected behavior:
The branch does not exist on the remote, so we expect to be directed to the file on sourcegraph.com on the master
branch. The URL should be similar to: https://sourcegraph.com/github.com/wukkuan/sourcegraph-test@master/-/blob/README.md
Actual behavior:
We are directed to the file on sourcegraph.com on the main
branch (which does not exist) and see a 404
error. The URL is similar to: https://sourcegraph.com/github.com/wukkuan/sourcegraph-test@test/-/blob/README.md
If I remove the sourcegraph.defaultBranch
setting I am prompted to choose between "main" and cancelling.