Skip to content
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

Git: Support optional branch picking in the repository picker #106664

Closed
egamma opened this issue Sep 14, 2020 · 3 comments
Closed

Git: Support optional branch picking in the repository picker #106664

egamma opened this issue Sep 14, 2020 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality git GIT issues insiders-released Patch has been released in VS Code Insiders on-release-notes Issue/pull request mentioned in release notes on-testplan
Milestone

Comments

@egamma
Copy link
Member

egamma commented Sep 14, 2020

No description provided.

@egamma egamma added git GIT issues feature-request Request for new features or functionality labels Sep 14, 2020
@joaomoreno
Copy link
Member

Pushing this out, unfortunately.

@joaomoreno
Copy link
Member

A RemoteSourceProvider can now optionally implemented getBranches:

export interface RemoteSourceProvider {
	getBranches?(url: string): ProviderResult<string[]>;
}

I've implemented it for our Github extension.

And when passing branch: true to the git.api.getRemoteSources API command, the user will be prompted to pick a branch, if the provider implements getBranches:

await commands.executeCommand('git.api.getRemoteSources', {
	providerLabel: (provider: RemoteSourceProvider) => `Test this for ${provider.name}`,
	urlLabel: `Test this for URL`,
	branch: true
});

And the result will be the following object instead of a string:

export interface PickRemoteSourceResult {
	readonly url: string;
	readonly branch?: string;
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality git GIT issues insiders-released Patch has been released in VS Code Insiders on-release-notes Issue/pull request mentioned in release notes on-testplan
Projects
None yet
Development

No branches or pull requests

3 participants
@joaomoreno @egamma and others