mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 23:48:34 +02:00
fixed git push target graph difference method bug
This commit is contained in:
parent
c98f979885
commit
fad9661f30
6 changed files with 39 additions and 6 deletions
|
@ -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;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue