From 92e1541b7052bf9d3b4924c3504a7c8d773a52c7 Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Sun, 4 Nov 2012 17:14:29 -0800 Subject: [PATCH] cherry pick error --- src/git.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/git.js b/src/git.js index 15e2d614..a515cf5b 100644 --- a/src/git.js +++ b/src/git.js @@ -464,6 +464,15 @@ GitEngine.prototype.cherrypickStarter = function() { GitEngine.prototype.cherrypick = function(ref) { var commit = this.getCommitFromRef(ref); + // check if we already have that + var set = this.getUpstreamSet('HEAD'); + if (set[commit.get('id')]) { + throw new GitError({ + msg: "We already have that commit in our changes history! You can't cherry-pick it " + + "if it shows up in git log." + }); + } + // alter the ID slightly var id = this.rebaseAltID(commit.get('id'));