Do not parse dune-project files in ignored directories

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
This commit is contained in:
Jeremie Dimino 2018-07-09 10:03:32 +01:00 committed by Jérémie Dimino
parent d393630152
commit e05fcb7631
1 changed files with 8 additions and 8 deletions

View File

@ -206,15 +206,15 @@ let load ?(extra_ignored_subtrees=Path.Set.empty) path =
~compare:(fun (a, _, _) (b, _, _) -> String.compare a b)
sub_dirs
in
let project =
match Dune_project.load ~dir:path ~files with
| Some x -> x
| None -> project
in
let dune_file, ignored_subdirs =
let project, dune_file, ignored_subdirs =
if ignored then
(None, String.Set.empty)
(project, None, String.Set.empty)
else
let project =
match Dune_project.load ~dir:path ~files with
| Some x -> x
| None -> project
in
let dune_file, ignored_subdirs =
match List.filter ["dune"; "jbuild"] ~f:(String.Set.mem files) with
| [] -> (None, String.Set.empty)
@ -238,7 +238,7 @@ let load ?(extra_ignored_subtrees=Path.Set.empty) path =
else
ignored_subdirs
in
(dune_file, ignored_subdirs)
(project, dune_file, ignored_subdirs)
in
let sub_dirs =
List.fold_left sub_dirs ~init:String.Map.empty