pub struct RootScan {
pub root: PathBuf,
pub repos: Vec<PathBuf>,
pub skipped: Vec<PathBuf>,
pub worktrees: Vec<PathBuf>,
}Expand description
What a shallow scan of one root found, including what it walked past.
discover_repos_under answers the membership question and is what building
a workspace uses. This answers the diagnostic one, because the shallow rule is
invisible at exactly the moment it matters: a root whose repos all live one
level deeper (~/GIT/<org>/<repo>, a common layout) yields a near-empty
workspace and no error, so the failure presents later as “the graph tools
return nothing useful” rather than as a configuration mistake (issue #580).
The rule itself is deliberate and is not what this changes — see
discover_repos_under.
Fields§
§root: PathBufThe root scanned.
repos: Vec<PathBuf>Repos found: the root itself if it is one, plus each immediate subdirectory that is one, sorted.
skipped: Vec<PathBuf>Immediate subdirectories that are not repos, sorted. A repo nested inside one of these is not hosted; counting them is free here because the scan already read the directory, which is why the successful-start note can report it without a second pass.
worktrees: Vec<PathBuf>Immediate subdirectories that are repos but were walked past for being
linked git worktrees, sorted. Always empty under
Worktrees::Include, because then they are in RootScan::repos.
A separate list rather than more entries in RootScan::skipped: the two
are skipped for opposite reasons and have opposite remedies. A subdirectory
with no .git is a layout the user may have meant to reach one level
deeper; a worktree is a directory we found a repository in and declined, and
saying so is the whole point of #837 — the behaviour it replaces was already
silent, and a silent skip would only move the silence.
Implementations§
Source§impl RootScan
impl RootScan
Sourcepub fn nested_repo_parents(&self, limit: usize) -> Vec<&Path>
pub fn nested_repo_parents(&self, limit: usize) -> Vec<&Path>
Which skipped subdirectories hold a repo directly beneath them — the ones a user almost certainly meant to reach.
Costs one read_dir per skipped directory, so it is bounded by limit
and is for the path where the user is already stuck: a root that yielded
nothing to serve. A successful start reports RootScan::skipped instead,
which the scan already knows.
Trait Implementations§
impl Eq for RootScan
impl StructuralPartialEq for RootScan
Auto Trait Implementations§
impl Freeze for RootScan
impl RefUnwindSafe for RootScan
impl Send for RootScan
impl Sync for RootScan
impl Unpin for RootScan
impl UnsafeUnpin for RootScan
impl UnwindSafe for RootScan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.