Skip to main content

git_tree_get

Function git_tree_get 

Source
pub fn git_tree_get(
    git_tree: &mut GitTree,
    name_or_url: &str,
) -> Result<GitRepo, Box<EvalAltResult>>
Expand description

Wrapper for GitTree::get

Gets a single GitRepo object based on an exact name or URL. The underlying Rust GitTree::get method returns Result<Vec, GitError>. This wrapper ensures that for Rhai, ‘get’ returns a single GitRepo or an error if zero or multiple repositories are found (for local names/patterns), or if a URL operation fails or unexpectedly yields not exactly one result.