use std::{ collections::{BTreeMap, btree_map::Entry}, ffi::OsStr, ops::ControlFlow, path::{Path, PathBuf}, sync::Arc, }; /// [RootPathTrie] is a workhorse of [super::ManifestTree]. It is responsible for determining the closest known project root for a given path. /// It also determines how much of a given path is unexplored, thus letting callers fill in that gap if needed. /// Conceptually, it allows one to annotate Worktree entries with arbitrary extra metadata and run closest-ancestor searches. /// /// A path is unexplored when the closest ancestor of a path is not the path itself; that means that we have not yet ran the scan on that path. /// For example, if there's a project root at path `python/project` and we query for a path `python/project/subdir/another_subdir/file.py`, there is /// a known root at `python/project` and the unexplored part is `subdir/another_subdir` - we need to run a scan on these 2 directories. pub(super) struct RootPathTrie