mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-02 02:34:26 +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);
|
||||
|
|
|
@ -28,7 +28,9 @@ var toGlobalize = {
|
|||
};
|
||||
|
||||
_.each(toGlobalize, function(module) {
|
||||
_.extend(window, module);
|
||||
for (var key in module) {
|
||||
window['debug_' + key] = module[key];
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
|
@ -37,5 +39,6 @@ $(document).ready(function() {
|
|||
window.sandbox = toGlobalize.Main.getSandbox();
|
||||
window.modules = toGlobalize;
|
||||
window.levelDropdown = toGlobalize.Main.getLevelDropdown();
|
||||
window.under = _;
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue