mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
cherry pick error
This commit is contained in:
parent
e021e6fd9b
commit
92e1541b70
1 changed files with 9 additions and 0 deletions
|
@ -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'));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue