pijul_org / pijul

Cleanup in libpijul::fs_representation

By blabla on February 27, 2019
This patch is not signed.
7rybBGVA9f34FFe6ZSFBQtroEH79BVsaPQZzvCqVVAtENLwiQ6K4v82mgoKJLUW6HDTfyP8DqKc7HEqg1JvFVpad
This patch is in the following branches:
latest
master
testing
358
359

























































    Ok(r)
}
/*
impl<T: sanakirja::Transaction, R> GenericTxn<T, R> {
impl<T: sanakirja::Transaction, R> GenericTxn<T, R> {
    pub fn with_untracked_files<P:AsRef<Path>, Q:AsRef<Path>, E: From<std::io::Error>, F:FnMut(PathBuf) -> std::result::Result<bool, E>>(&self, repo_root: P, path: Q, mut f: F) -> std::result::Result<(), E> {



        let o = OverrideBuilder::new(repo_root.as_ref())
            .add("!.pijul")
            .unwrap()
            .build()
            .unwrap(); // we can be pretty confident these two calls will
        // not fail as the glob is hard-coded
        debug!("walkbuilder");
        let mut w = WalkBuilder::new(path.as_ref());
        w.git_ignore(false)
            .git_exclude(false)
            .git_global(false)
            .hidden(false)
            .add_custom_ignore_filename(".pijulignore");



        debug!("adding .pijul/local/ignore");
        // add .pijul/local/ignore
        w.add_ignore(ignore_file(repo_root.as_ref()));
        w.overrides(o);
        debug!("Iterating!");
        for file in w.build() {
            debug!("untracked f = {:?}", file);
            if let Ok(file) = file {
                let p = file.path();
                if p == repo_root.as_ref() {
                    continue
                }
                let pb = p.to_path_buf();
                if let Ok(stripped) = p.strip_prefix(repo_root.as_ref()) {
                    if self.find_inode(&stripped).is_ok() {
                        continue
                    }
                }
                if !f(pb)? {
                    break
                }
                }
                }
            }
            Ok(())
        }
        }
        }
        }
    }
}
}
}
*/