mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-22 17:26:10 -05:00
Adds new GitLens custom view
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
import { Arrays } from '../system';
|
||||
import { commands, TextEditor, Uri, window } from 'vscode';
|
||||
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||
import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommandViewContextWithBranch } from './common';
|
||||
import { GlyphChars } from '../constants';
|
||||
import { GitService, GitUri } from '../gitService';
|
||||
import { Logger } from '../logger';
|
||||
@@ -18,6 +18,16 @@ export class OpenBranchInRemoteCommand extends ActiveEditorCommand {
|
||||
super(Commands.OpenBranchInRemote);
|
||||
}
|
||||
|
||||
protected async preExecute(context: CommandContext, args: OpenBranchInRemoteCommandArgs = {}): Promise<any> {
|
||||
if (isCommandViewContextWithBranch(context)) {
|
||||
args = { ...args };
|
||||
args.branch = context.node.branch.name;
|
||||
return this.execute(context.editor, context.uri, args);
|
||||
}
|
||||
|
||||
return this.execute(context.editor, context.uri, args);
|
||||
}
|
||||
|
||||
async execute(editor?: TextEditor, uri?: Uri, args: OpenBranchInRemoteCommandArgs = {}) {
|
||||
uri = getCommandUri(uri, editor);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user