cherry pick error

This commit is contained in:
Peter Cottle 2012-11-04 17:14:29 -08:00
parent e021e6fd9b
commit 92e1541b70

View file

@ -464,6 +464,15 @@ GitEngine.prototype.cherrypickStarter = function() {
GitEngine.prototype.cherrypick = function(ref) { GitEngine.prototype.cherrypick = function(ref) {
var commit = this.getCommitFromRef(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 // alter the ID slightly
var id = this.rebaseAltID(commit.get('id')); var id = this.rebaseAltID(commit.get('id'));