fixed tests

This commit is contained in:
Peter Cottle 2013-10-07 16:54:54 -07:00
parent 9e3b9cd911
commit 541ae67fbd
3 changed files with 142 additions and 3 deletions

View file

@ -328,6 +328,11 @@ TreeCompare.reduceTreeFields = function(trees) {
'remoteTrackingBranchID',
'localBranchesThatTrackThis'
];
// for backwards compatibility, fill in some fields if missing
var defaults = {
remoteTrackingBranchID: null,
localBranchesThatTrackThis: null
};
// this function saves only the specified fields of a tree
var saveOnly = function(tree, treeKey, saveFields, sortFields) {
@ -338,6 +343,8 @@ TreeCompare.reduceTreeFields = function(trees) {
_.each(saveFields, function(field) {
if (obj[field] !== undefined) {
blank[field] = obj[field];
} else if (defaults[field] !== undefined) {
blank[field] = defaults[field];
}
});