mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 07:28:35 +02:00
now with errors
This commit is contained in:
parent
9a86845ead
commit
625c15d51e
3 changed files with 26 additions and 20 deletions
|
@ -2046,25 +2046,8 @@ GitEngine.prototype.getUpstreamDiffSetFromSet = function(stopSet, location) {
|
|||
};
|
||||
|
||||
GitEngine.prototype.getUpstreamDiffFromSet = function(stopSet, location) {
|
||||
// now BFS from here on out
|
||||
var result = [];
|
||||
var pQueue = [this.getCommitFromRef(location)];
|
||||
|
||||
while (pQueue.length) {
|
||||
var popped = pQueue.pop();
|
||||
|
||||
// if its in the set, dont add it
|
||||
if (stopSet[popped.get('id')]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// it's not in the set, so we need to rebase this commit
|
||||
result.push(popped);
|
||||
result.sort(this.dateSortFunc);
|
||||
|
||||
// keep searching
|
||||
pQueue = pQueue.concat(popped.get('parents'));
|
||||
}
|
||||
var result = Graph.bfsFromLocationWithSet(this, location, stopSet);
|
||||
result.sort(this.dateSortFunc);
|
||||
return result;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue