From 29d1689f8747803b91feb1a91a0ec12ff833198e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dimino?= Date: Thu, 2 Aug 2018 10:58:42 +0100 Subject: [PATCH] Fix bug in Dir_contents (#1085) Signed-off-by: Jeremie Dimino --- src/dir_contents.ml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/dir_contents.ml b/src/dir_contents.ml index 6f1e0573..89d5fbf1 100644 --- a/src/dir_contents.ml +++ b/src/dir_contents.ml @@ -567,9 +567,14 @@ let rec get sctx ~dir = in Hashtbl.add cache dir t; t - | Is_component_of_a_group_but_not_the_root _ -> - (* Filled while scanning the group root *) - Option.value_exn (Hashtbl.find cache dir) + | Is_component_of_a_group_but_not_the_root _ -> begin + match Hashtbl.find cache dir with + | Some t -> t + | None -> + ignore (get sctx ~dir:(Path.parent_exn dir) : t); + (* Filled while scanning the group root *) + Option.value_exn (Hashtbl.find cache dir) + end | Standalone (ft_dir, d) -> let files = load_text_files sctx ft_dir d in let t =