Skip to content

Commit

Permalink
wip: optional branch picking in the repository picker
Browse files Browse the repository at this point in the history
related to #106664
  • Loading branch information
joaomoreno committed Sep 28, 2020
1 parent 212fc3d commit 0301885
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions extensions/git/src/api/git.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ export interface RemoteSourceProvider {
readonly icon?: string; // codicon name
readonly supportsQuery?: boolean;
getRemoteSources(query?: string): ProviderResult<RemoteSource[]>;
getBranches?(remoteSource: RemoteSource): ProviderResult<string[]>;
publishRepository?(repository: Repository): Promise<void>;
}

Expand Down
8 changes: 7 additions & 1 deletion extensions/git/src/remoteSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,15 @@ class RemoteSourceProviderQuickPick {
export interface PickRemoteSourceOptions {
readonly providerLabel?: (provider: RemoteSourceProvider) => string;
readonly urlLabel?: string;
readonly branch?: boolean; // then result is PickRemoteSourceResult
}

export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions = {}): Promise<string | undefined> {
export interface PickRemoteSourceResult {
readonly url: string;
readonly branch: string;
}

export async function pickRemoteSource(model: Model, options: PickRemoteSourceOptions = {}): Promise<string | PickRemoteSourceResult | undefined> {
const quickpick = window.createQuickPick<(QuickPickItem & { provider?: RemoteSourceProvider, url?: string })>();
quickpick.ignoreFocusOut = true;

Expand Down

0 comments on commit 0301885

Please sign in to comment.