Reworks commanding structure for less redundancy

Adds command args copying when needed
This commit is contained in:
Eric Amodio
2017-06-27 19:28:14 -04:00
parent 8693c87523
commit 0a9559f5a5
36 changed files with 179 additions and 219 deletions

View File

@@ -18,7 +18,7 @@ export class OpenBranchInRemoteCommand extends ActiveEditorCommand {
super(Commands.OpenBranchInRemote);
}
async execute(editor: TextEditor, uri?: Uri, args: OpenBranchInRemoteCommandArgs = {}) {
async execute(editor?: TextEditor, uri?: Uri, args: OpenBranchInRemoteCommandArgs = {}) {
uri = getCommandUri(uri, editor);
const gitUri = uri && await GitUri.fromUri(uri, this.git);
@@ -28,6 +28,8 @@ export class OpenBranchInRemoteCommand extends ActiveEditorCommand {
try {
if (args.branch === undefined) {
args = { ...args };
const branches = await this.git.getBranches(repoPath);
const pick = await BranchesQuickPick.show(branches, `Show history for branch${GlyphChars.Ellipsis}`);