Skip to content

Commit 3d04c55

Browse files
committed
support multiple URLs
1 parent bfcc591 commit 3d04c55

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

extensions/git/src/api/git.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export interface Repository {
192192

193193
export interface RemoteSource {
194194
readonly name: string;
195-
readonly url: string;
195+
readonly url: string | string[];
196196
}
197197

198198
export interface RemoteSourceProvider {

extensions/git/src/commands.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,8 +281,8 @@ class RemoteSourceProviderQuickPick {
281281
} else {
282282
this.quickpick.items = remoteSources.map(remoteSource => ({
283283
label: remoteSource.name,
284-
description: remoteSource.url,
285-
remote: remoteSource
284+
description: typeof remoteSource.url === 'string' ? remoteSource.url : '',
285+
remoteSource
286286
}));
287287
}
288288
} catch (err) {
@@ -552,7 +552,14 @@ export class CommandCenter {
552552
if (result.provider) {
553553
const quickpick = new RemoteSourceProviderQuickPick(result.provider);
554554
const remote = await quickpick.pick();
555-
url = remote?.url;
555+
556+
if (remote) {
557+
if (typeof remote.url === 'string') {
558+
url = remote.url;
559+
} else if (remote.url.length > 0) {
560+
url = await window.showQuickPick(remote.url, { ignoreFocusOut: true, placeHolder: localize('pick url', "Choose a URL to clone from.") });
561+
}
562+
}
556563
} else {
557564
url = result.label;
558565
}

0 commit comments

Comments
 (0)