Browse Source

Improves multiselect support for cherry-pick

main
Eric Amodio 2 years ago
parent
commit
ff72918fca
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      src/views/viewCommands.ts

+ 9
- 2
src/views/viewCommands.ts View File

@ -245,7 +245,7 @@ export class ViewCommands {
this,
);
this.registerCommand('gitlens.views.cherryPick', this.cherryPick, this);
this.registerCommand('gitlens.views.cherryPick', this.cherryPick, this, ViewCommandMultiSelectMode.Custom);
this.registerCommand('gitlens.views.createBranch', this.createBranch, this);
this.registerCommand('gitlens.views.deleteBranch', this.deleteBranch, this);
this.registerCommand('gitlens.views.renameBranch', this.renameBranch, this);
@ -326,9 +326,16 @@ export class ViewCommands {
}
@debug()
private cherryPick(node: CommitNode) {
private cherryPick(node: CommitNode, nodes?: CommitNode[]) {
if (!(node instanceof CommitNode)) return Promise.resolve();
if (nodes != null && nodes.length !== 0) {
return GitActions.cherryPick(
node.repoPath,
nodes.map(n => n.ref),
);
}
return GitActions.cherryPick(node.repoPath, node.ref);
}

Loading…
Cancel
Save