Crate gitall

Source
Expand description

Crate gitall provides an simple API for recursively finding all Git directories below a given directory.

§Example

The following code prints the directory paths of each Git directory located beneath the current directory:

use gitall::Giterator;
use std::default::Default;

let giterator = Giterator::default();
for direntry in giterator {
    println!("{}", direntry.path().display());
}

This snippet only finds Git directories whose name matches a regular expression:

use gitall::Giterator;
use regex::Regex;
use std::default::Default;

let giterator = Giterator::default().regex(Regex::new(r"some-pattern-.+").unwrap());
for direntry in giterator {
    println!("{}", direntry.path().display());
}

Check the Giterator documentation for more ways to filter results.

Structs§

Giterator
A builder to define how to search for Git directories.
IntoIter
An iterator for recursively finding Git directories.

Functions§

is_git_dir
Returns true if the directory represented by entry is a Git directory root.