mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-19 09:45:36 -05:00
Adds gitlens.openBranchInRemote command
Adds gitlens.openRepoInRemote command
This commit is contained in:
@@ -32,6 +32,16 @@ export class OpenInRemoteCommand extends ActiveEditorCommand {
|
||||
let placeHolder: string = '';
|
||||
switch (args.resource.type) {
|
||||
case 'branch':
|
||||
// Check to see if the remote is in the branch
|
||||
const index = args.resource.branch.indexOf('/');
|
||||
if (index >= 0) {
|
||||
const remoteName = args.resource.branch.substring(0, index);
|
||||
const remote = args.remotes.find(r => r.name === remoteName);
|
||||
if (remote !== undefined) {
|
||||
args.resource.branch = args.resource.branch.substring(index + 1);
|
||||
args.remotes = [remote];
|
||||
}
|
||||
}
|
||||
placeHolder = `open ${args.resource.branch} branch in\u2026`;
|
||||
break;
|
||||
|
||||
@@ -64,6 +74,11 @@ export class OpenInRemoteCommand extends ActiveEditorCommand {
|
||||
break;
|
||||
}
|
||||
|
||||
if (args.remotes.length === 1) {
|
||||
const command = new OpenRemoteCommandQuickPickItem(args.remotes[0], args.resource);
|
||||
return command.execute();
|
||||
}
|
||||
|
||||
const pick = await RemotesQuickPick.show(args.remotes, placeHolder, args.resource, args.goBackCommand);
|
||||
if (pick === undefined) return undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user