Skip to main content

is_inside_work_tree

Function is_inside_work_tree 

Source
pub fn is_inside_work_tree() -> Result<bool>
Expand description

Checks if the current directory is inside a Git work tree.

§Returns

A Result containing a boolean indicating if inside a work tree or an error.

§Errors

Returns an error only if the Git command cannot be spawned. Git reporting a non-repository directory is normalized to Ok(false).