more bugs squashed

This commit is contained in:
Peter Cottle 2013-01-12 13:12:35 -08:00
parent e844b5b25f
commit ddaf71fc34
3 changed files with 35 additions and 7 deletions

View file

@ -977,7 +977,6 @@ GitEngine.prototype.rebase = function(targetSource, currentLocation) {
// keep searching
pQueue = pQueue.concat(popped.get('parents'));
}
console.log('this is what our rebase rough array is', toRebaseRough);
return this.rebaseFinish(toRebaseRough, stopSet, targetSource, currentLocation);
};
@ -1092,6 +1091,17 @@ GitEngine.prototype.rebaseFinish = function(toRebaseRough, stopSet, targetSource
}
}, this);
toRebaseRough = toRebase;
toRebase = [];
// finally, make the set unique
var uniqueIDs = {};
_.each(toRebaseRough, function(commit) {
if (uniqueIDs[commit.get('id')]) { return; }
uniqueIDs[commit.get('id')] = true;
toRebase.push(commit);
}, this);
if (!toRebase.length) {
throw new GitError({
msg: 'No Commits to Rebase! Everything else is merge commits or changes already have been applied'