From ff72918fcabc5e168f4d4cdfbbb0e0ba76e226b6 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 16 Aug 2022 15:00:26 -0400 Subject: [PATCH] Improves multiselect support for cherry-pick --- src/views/viewCommands.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/views/viewCommands.ts b/src/views/viewCommands.ts index ddb2bbf..6d9dc05 100644 --- a/src/views/viewCommands.ts +++ b/src/views/viewCommands.ts @@ -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); }