mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
now with errors
This commit is contained in:
parent
9a86845ead
commit
625c15d51e
3 changed files with 26 additions and 20 deletions
|
@ -95,6 +95,23 @@ var Graph = {
|
|||
});
|
||||
},
|
||||
|
||||
bfsFromLocationWithSet: function(engine, location, set) {
|
||||
var result = [];
|
||||
var pQueue = [engine.getCommitFromRef(location)];
|
||||
|
||||
while (pQueue.length) {
|
||||
var popped = pQueue.pop();
|
||||
if (set[popped.get('id')]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
result.push(popped);
|
||||
// keep searching
|
||||
pQueue = pQueue.concat(popped.get('parents'));
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
getUniqueObjects: function(objects) {
|
||||
var unique = {};
|
||||
var result = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue