Skip to content

fix(git): filter out fork username when checking out branch #208514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Mar 23, 2024

Motivation: GitHub PRs have a copy button for their head branch. If it's a fork, it contains the username as a prefix, e.g. username:branchname. This PR will filter the first part out. (: as a character is not allowed as a branch name).

This required me to introduce a new proposed API to the QuickPick element, allowing it to use a regular expression pattern to filter its items. Implementing a callback based approach like it was already implemented on the actual widget seems not great, due to the async nature of the extension host -> main process communication.

Whats the best way of covering it with tests?

Thats the button:

image

Fixes #201012

@mxschmitt mxschmitt marked this pull request as draft March 23, 2024 23:26
@mxschmitt mxschmitt force-pushed the feature/git-extension-checkout-branch-filter-out-usernames branch from d214b56 to 3834b82 Compare March 23, 2024 23:31
@mxschmitt mxschmitt marked this pull request as ready for review March 23, 2024 23:32
@lszomoru lszomoru added the git GIT issues label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
git GIT issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Split branch name by colon so GitHub PR branch name copy works from forks
2 participants