summaryrefslogtreecommitdiff
path: root/src/config_diff.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/config_diff.ml')
-rw-r--r--src/config_diff.ml10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/config_diff.ml b/src/config_diff.ml
index c00705d..cbb4544 100644
--- a/src/config_diff.ml
+++ b/src/config_diff.ml
@@ -792,19 +792,19 @@ let subtree_from_partial reftree ctree result path =
| [] -> false
| _ -> (Vytree.exists[@alert "-exn"]) ctree p
in
- let clone_node tree p =
+ let clone_node ?(recurse=false) tree p =
if (Vytree.exists[@alert "-exn"]) tree p then
tree
else
if not ((Vytree.exists[@alert "-exn"]) ctree p) then
tree
else
- clone ~recurse:false ctree tree p
+ clone ~recurse:recurse ctree tree p
in
let clone_children tree p =
let children = Vytree.list_children ((Vytree.get[@alert "-exn"]) ctree p) in
let paths = List.map (fun n -> p @ [n]) children in
- List.fold_left clone_node tree paths
+ List.fold_left (clone_node ~recurse:true) tree paths
in
let rec aux acc path_done p =
if not (check_reftree (path_done @ p)) then
@@ -833,9 +833,7 @@ let subtree_from_partial reftree ctree result path =
else
(* [h] is a tag_value not present in the config tree *)
raise (Malformed_path (Util.string_of_list p'))
- | _, [] ->
- if (Config_tree.is_tag[@alert "-exn"]) ctree path_done then clone_children acc path_done
- else acc
+ | _, [] -> clone_children acc path_done
in aux result [] path