Skip to content

VSCE: Implement function to validate current branch

Warren Gifford requested to merge bee/vsce-links-commands into main

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.

Screen Shot 2022-05-17 at 9 26 58 PM

For remote files, only current branch is available: Screen Shot 2022-05-17 at 9 26 44 PM

TODO

Test plan

Manually tested. See loom video

App preview:

Check out the client app preview documentation to learn more.

Merge request reports

Loading