pub struct GitTree { /* private fields */ }
Expand description
Represents a collection of git repositories under a base path.
Implementations§
Source§impl GitTree
impl GitTree
Sourcepub fn list(&self) -> Result<Vec<String>, GitError>
pub fn list(&self) -> Result<Vec<String>, GitError>
Lists all git repositories under the base path.
§Returns
Ok(Vec<String>)
- A vector of paths to git repositoriesErr(GitError)
- If the operation failed
Sourcepub fn find(&self, pattern: &str) -> Result<Vec<GitRepo>, GitError>
pub fn find(&self, pattern: &str) -> Result<Vec<GitRepo>, GitError>
Finds repositories matching a pattern or partial path.
§Arguments
pattern
- The pattern to match against repository paths- If the pattern ends with ‘*’, all matching repositories are returned
- Otherwise, exactly one matching repository must be found
§Returns
Ok(Vec<String>)
- A vector of paths to matching repositoriesErr(GitError)
- If no matching repositories are found, or if multiple repositories match a non-wildcard pattern
Sourcepub fn get(&self, path_or_url: &str) -> Result<Vec<GitRepo>, GitError>
pub fn get(&self, path_or_url: &str) -> Result<Vec<GitRepo>, GitError>
Gets one or more GitRepo objects based on a path pattern or URL.
§Arguments
path_or_url
- The path pattern to match against repository paths or a git URL- If it’s a URL, the repository will be cloned if it doesn’t exist
- If it’s a path pattern, it will find matching repositories
§Returns
Ok(Vec<GitRepo>)
- A vector of GitRepo objectsErr(GitError)
- If no matching repositories are found or the clone operation failed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GitTree
impl RefUnwindSafe for GitTree
impl Send for GitTree
impl Sync for GitTree
impl Unpin for GitTree
impl UnwindSafe for GitTree
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
Mutably borrows from an owned value. Read more