Complete historical inventory and query services
This commit is contained in:
@@ -222,7 +222,7 @@ func collectFieldInfo(node *document.Node, path Path, decoded decodedConfigurati
|
||||
}
|
||||
|
||||
func cloneMetadata(metadata Metadata) Metadata {
|
||||
if metadata.fields == nil && metadata.history == nil {
|
||||
if metadata.fields == nil && metadata.history == nil && metadata.historyModel == nil {
|
||||
return Metadata{}
|
||||
}
|
||||
cloned := Metadata{
|
||||
@@ -230,15 +230,12 @@ func cloneMetadata(metadata Metadata) Metadata {
|
||||
history: make(map[string][]Change, len(metadata.history)),
|
||||
inheritance: append([]inheritanceOperation(nil), metadata.inheritance...),
|
||||
inheritanceIndex: metadata.inheritanceIndex,
|
||||
historyModel: metadata.historyModel,
|
||||
}
|
||||
cloned.effectivePaths = make(map[string]Path, len(metadata.effectivePaths))
|
||||
for pointer, path := range metadata.effectivePaths {
|
||||
cloned.effectivePaths[pointer] = path.clone()
|
||||
}
|
||||
cloned.historicalPaths = make(map[string][]Path, len(metadata.historicalPaths))
|
||||
for pointer, paths := range metadata.historicalPaths {
|
||||
cloned.historicalPaths[pointer] = clonePaths(paths)
|
||||
}
|
||||
for path, info := range metadata.fields {
|
||||
cloned.fields[path] = cloneFieldInfo(info)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user