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

@ -7839,7 +7839,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;
});
@ -24004,7 +24015,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;
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
build/bundle.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -434,7 +434,7 @@
For a much easier time perusing the source, see the individual files at:
https://github.com/pcottle/learnGitBranching
-->
<script src="build/bundle.min.c159cb3d.js"></script>
<script src="build/bundle.min.13132f0d.js"></script>
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
The downside? No raw logs to parse for analytics, so I have to include

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;
});