mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-24 23:18:35 +02:00
fixed tests
This commit is contained in:
parent
9e3b9cd911
commit
541ae67fbd
3 changed files with 142 additions and 3 deletions
|
@ -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];
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue