Skip to main content

Module clone

Module clone 

Source
Expand description

Parallel cloning operations.

This module provides functionality for cloning repositories, including parallel cloning with controlled concurrency.

§Example

use git_same::operations::clone::{CloneManager, CloneManagerOptions, NoProgress};
use git_same::git::ShellGit;
use std::path::Path;

let git = ShellGit::new();
let options = CloneManagerOptions::new()
    .with_concurrency(4)
    .with_structure("{org}/{repo}");

let manager = CloneManager::new(git, options);

// repos would come from discovery
let repos = vec![];
let progress = NoProgress;

let (summary, results) = manager
    .clone_repos(Path::new("~/github"), repos, "github", std::sync::Arc::new(progress))
    .await;

println!("Cloned {} repos, {} failed", summary.success, summary.failed);

Structs§

CloneManager
Manages parallel clone operations.
CloneManagerOptions
Options for the clone manager.
CloneResult
Result of a single clone operation.
NoProgress
A no-op progress implementation for when no progress reporting is needed.

Constants§

DEFAULT_CONCURRENCY
Default concurrency when not specified in config.
MAX_CONCURRENCY
Maximum allowed concurrency to prevent resource exhaustion. Higher values can cause “too many open files” errors and network saturation.
MIN_CONCURRENCY
Minimum concurrency (at least one clone at a time).

Traits§

CloneProgress
Progress callback for clone operations.