VSCE: Implement function to validate current branch
Created by: abeatrix
Close https://github.com/sourcegraph/sourcegraph/issues/34591
Summary
This PR implements a function to check if the current branch exists on the sourcegraph instance
If the user is currently on a branch that does not exist remotely, the links-commands will open the repo using the "HEAD" (aka main) branch unless a default branch has been set
Expected Behavior
For local files, users can choose between open / copy the main branch and the current branch.
- If the current branch does not exist remotely, it will fall back to the main branch.
- If the default branch is set, it will replace the current branch option when clicked.
For remote files, only current branch is available:
TODO
-
Loom video: https://www.loom.com/share/b5e326959696455986cf68088a53b28a -
Test with different remote URL
Test plan
Manually tested. See loom video
App preview:
Check out the client app preview documentation to learn more.