mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-24 23:18:35 +02:00
working on tree compare tests etc
This commit is contained in:
parent
89fa08e149
commit
3d8e40851e
5 changed files with 71 additions and 4 deletions
|
@ -3,6 +3,29 @@ var _ = require('underscore');
|
|||
// static class...
|
||||
var TreeCompare = {};
|
||||
|
||||
TreeCompare.dispatchFromLevel = function(levelBlob, treeToCompare) {
|
||||
var goalTreeString = levelBlob.goalTreeString;
|
||||
return TreeCompare.dispatch(levelBlob, goalTreeString, treeToCompare);
|
||||
};
|
||||
|
||||
TreeCompare.dispatch = function(levelBlob, goalTreeString, treeToCompare) {
|
||||
switch(true) {
|
||||
case !!levelBlob.compareOnlyMaster:
|
||||
return TreeCompare.compareBranchWithinTrees(current, goalTreeString, 'master');
|
||||
case !!levelBlob.compareOnlyBranches:
|
||||
return TreeCompare.compareAllBranchesWithinTrees(current, goalTreeString);
|
||||
case !!levelBlob.compareAllBranchesHashAgnostic:
|
||||
return TreeCompare.compareAllBranchesWithinTreesHashAgnostic(current, goalTreeString);
|
||||
case !!levelBlob.compareOnlyMasterHashAgnostic:
|
||||
return TreeCompare.compareBranchesWithinTreesHashAgnostic(current, goalTreeString, ['master']);
|
||||
case !!levelBlob.compareOnlyMasterHashAgnosticWithAsserts:
|
||||
return TreeCompare.compareBranchesWithinTreesHashAgnostic(current, goalTreeString, ['master']) &&
|
||||
TreeCompare.evalAsserts(current, levelBlob.goalAsserts);
|
||||
default:
|
||||
return TreeCompare.compareAllBranchesWithinTreesAndHEAD(current, goalTreeString);
|
||||
}
|
||||
};
|
||||
|
||||
// would love to have copy properties here.. :(
|
||||
TreeCompare.compareAllBranchesWithinTreesAndHEAD = function(treeA, treeB) {
|
||||
treeA = this.convertTreeSafe(treeA);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue