From 2cb0add450292c992daf1020b10c3fc2d79ca7fd Mon Sep 17 00:00:00 2001 From: akonwi Date: Mon, 7 Nov 2016 15:39:57 -0600 Subject: [PATCH] Fix #509 --- lib/views/cherry-pick-select-commits-view.coffee | 2 +- spec/views/cherry-pick-select-commit-view-spec.coffee | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/views/cherry-pick-select-commits-view.coffee b/lib/views/cherry-pick-select-commits-view.coffee index 68786ca..0c6267c 100644 --- a/lib/views/cherry-pick-select-commits-view.coffee +++ b/lib/views/cherry-pick-select-commits-view.coffee @@ -52,7 +52,7 @@ class CherryPickSelectCommits extends SelectListMultipleView completed: (items) -> @cancel() - commits = item.hash for item in items + commits = items.map (item) -> item.hash git.cmd(['cherry-pick'].concat(commits), cwd: @repo.getWorkingDirectory()) .then (msg) -> notifier.addSuccess msg .catch (msg) -> notifier.addError msg diff --git a/spec/views/cherry-pick-select-commit-view-spec.coffee b/spec/views/cherry-pick-select-commit-view-spec.coffee index bcc9e3b..27205eb 100644 --- a/spec/views/cherry-pick-select-commit-view-spec.coffee +++ b/spec/views/cherry-pick-select-commit-view-spec.coffee @@ -12,5 +12,7 @@ describe "CherryPickSelectCommits view", -> it "calls git.cmd with 'cherry-pick' and the selected commits", -> spyOn(git, 'cmd').andReturn Promise.resolve 'success' @view.confirmSelection() + @view.selectNextItemView() + @view.confirmSelection() @view.find('.btn-pick-button').click() - expect(git.cmd).toHaveBeenCalledWith ['cherry-pick', 'commit1'], cwd: repo.getWorkingDirectory() + expect(git.cmd).toHaveBeenCalledWith ['cherry-pick', 'commit1', 'commit2'], cwd: repo.getWorkingDirectory()