fixed git push target graph difference method bug

This commit is contained in:
Peter Cottle 2013-06-27 18:47:39 -07:00
parent c98f979885
commit fad9661f30
6 changed files with 39 additions and 6 deletions

View file

@ -794,7 +794,18 @@ GitEngine.prototype.getTargetGraphDifference = function(
_.each(here.parents, pushParent);
}
return difference.sort(function(cA, cB) {
// filter because we werent doing graph search
var unique = {};
var differenceUnique = [];
_.forEach(difference, function(commit) {
if (unique[commit.id]) {
return;
}
unique[commit.id] = true;
differenceUnique.push(commit);
});
return differenceUnique.sort(function(cA, cB) {
// reverse sort by depth
return cB.depth - cA.depth;
});