Avoids remote disambiguation quick pick

This commit is contained in:
Eric Amodio
2017-09-04 01:37:30 -04:00
parent 5a42ce4ed4
commit 6d759daaad
4 changed files with 17 additions and 8 deletions

View File

@@ -8,6 +8,7 @@ import { Logger } from '../logger';
import { CommandQuickPickItem, OpenRemoteCommandQuickPickItem, RemotesQuickPick } from '../quickPicks';
export interface OpenInRemoteCommandArgs {
remote?: string;
remotes?: GitRemote[];
resource?: RemoteResource;
@@ -26,6 +27,14 @@ export class OpenInRemoteCommand extends ActiveEditorCommand {
args = { ...args };
if (args.remotes === undefined || args.resource === undefined) return undefined;
if (args.remote !== undefined) {
const remotes = args.remotes.filter(r => r.name === args.remote);
// Only filter if we get some results
if (remotes.length > 0) {
args.remotes = remotes;
}
}
try {
if (args.remotes.length === 1) {
this.ensureRemoteBranchName(args);