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

@@ -35,15 +35,13 @@ export class OpenRepoInRemoteCommand extends ActiveEditorCommand {
if (!repoPath) return undefined;
try {
let remotes = Arrays.uniqueBy(await this.git.getRemotes(repoPath), r => r.url, r => !!r.provider);
if (args.remote !== undefined) {
remotes = remotes.filter(r => r.name === args.remote);
}
const remotes = Arrays.uniqueBy(await this.git.getRemotes(repoPath), r => r.url, r => !!r.provider);
return commands.executeCommand(Commands.OpenInRemote, uri, {
resource: {
type: 'repo'
},
remote: args.remote,
remotes
} as OpenInRemoteCommandArgs);
}