Skip to main content

root

Function root 

Source
pub fn root() -> Root
Expand description

The workspace ROOT (project dir), falling back to cwd (the hook defaults root to cwd), or Root::Unknown when the context names a folder that is not a usable one: the unknown-folder sentinel, or a cd that could not be resolved.

An evaluation that was handed no context at all (a library caller, not a harness) has no workspace boundary to be wrong about, so its root is the empty Known(""): not an absolute path, so nothing is placed in it, and not unknown, so relative paths keep classifying as they always did without one. A harness always enters a context.