if let Ok(meta) = meta {
if meta.is_dir() {
let mut walk = WalkBuilder::new(&full);
walk.standard_filters(true);
let walk = walk.build();
for entry in walk {
let entry = entry?;
let p = entry.path();
if let Some(p) = p.file_name() {
if let Some(p) = p.to_str() {
if p.ends_with("~") || (p.starts_with("#") && p.ends_with("#")) {
continue;
let (sender, receiver) = std::sync::mpsc::sync_channel(100);
let full = full.to_path_buf();
let t = std::thread::spawn(move || -> Result<(), AddError<T::Error>> {
if let Ok(meta) = meta {
if meta.is_dir() {
let mut walk = WalkBuilder::new(&full);
walk.standard_filters(true);
walk.threads(threads - 1);
walk.build_parallel().run(|| {
Box::new(|entry| {
let entry: ignore::DirEntry = if let Ok(entry) = entry {
entry
} else {
return ignore::WalkState::Quit;
};
let p = entry.path();
if let Some(p) = p.file_name() {
if let Some(p) = p.to_str() {
if p.ends_with("~") || (p.starts_with("#") && p.ends_with("#"))
{
return ignore::WalkState::Skip;
}
}
}
debug!("entry path = {:?} {:?}", entry.path(), repo_path_);
if let Ok(path) = entry.path().strip_prefix(&repo_path_) {
let is_dir = entry.file_type().unwrap().is_dir();
sender.send((path.to_path_buf(), is_dir)).unwrap();
} else {
debug!("entry = {:?}", entry.path());