teamy-mft 0.7.1

TeamDman's Master File Table CLI and library for NTFS.
//! Find all git repositories visible in the MFT search index.
//!
// repo[impl examples.rs-files]
//! Uses `<.git>` (exact terminal-segment match) so it returns exact `.git`
//! directories without matching `.gitignore`, `.github`, `project.git`, etc.
//!
//! # Usage
//!
//! ```bash
//! cargo run --example query_git_repos
//! ```
//!
//! Requires a synced MFT index. Run `teamy-mft sync` first if needed.

use teamy_mft::cli::command::query::QueryArgs;

fn main() -> eyre::Result<()> {
    color_eyre::install()?;

    // `<.git>` means "terminal segment equals .git".
    let rows = QueryArgs::new("<.git>").collect_rows()?;
    for path in rows {
        // path is the .git dir; print its parent (the repo root)
        if let Some(repo_root) = path.parent() {
            println!("{} ({})", repo_root.display(), path.display());
        }
    }

    Ok(())
}