aboutsummaryrefslogtreecommitdiff
path: root/src/sync/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sync/mod.rs')
-rw-r--r--src/sync/mod.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/sync/mod.rs b/src/sync/mod.rs
index 6cf1f7f..4bfe322 100644
--- a/src/sync/mod.rs
+++ b/src/sync/mod.rs
@@ -1,17 +1,18 @@
use std::fmt::{Debug, Display};
-use crate::repo::{Repo, RepoError, Repos};
+use crate::{
+ batch::batch,
+ repo::{Repo, RepoError, Repos},
+};
impl crate::GTree {
pub fn sync(&self, repos: Repos) {
- for (_name, repo) in repos {
- let mut repo = repo.write().unwrap();
-
+ batch(repos, |mut repo| {
match repo.sync() {
Ok(u) => println!("{}", u),
Err(u) => println!("{}", u),
};
- }
+ });
}
}