Expand description
Sync manager for fetch and pull operations.
This module provides functionality for syncing existing local repositories with their remotes, including parallel fetch and pull operations.
§Example
use git_same::operations::sync::{SyncManager, SyncManagerOptions, SyncMode, LocalRepo, NoSyncProgress};
use git_same::git::ShellGit;
use git_same::types::{OwnedRepo, Repo};
use std::path::PathBuf;
let git = ShellGit::new();
let options = SyncManagerOptions::new()
.with_concurrency(4)
.with_mode(SyncMode::Fetch);
let manager = SyncManager::new(git, options);
// repos would come from discovery
let repos: Vec<LocalRepo> = vec![];
let progress = NoSyncProgress;
let (summary, results) = manager
.sync_repos(repos, std::sync::Arc::new(progress))
.await;
println!("Synced {} repos, {} had updates", summary.success,
results.iter().filter(|r| r.had_updates).count());Structs§
- Local
Repo - A repository with its local path for syncing.
- NoSync
Progress - A no-op progress implementation.
- Sync
Manager - Manages parallel sync operations.
- Sync
Manager Options - Options for the sync manager.
- Sync
Result - Result of a single sync operation.
Enums§
- Sync
Mode - Sync mode - fetch only or pull.
Traits§
- Sync
Progress - Progress callback for sync operations.