mod.rs 841 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. pub mod xattr;
  2. #[cfg(feature = "git")]
  3. pub mod git;
  4. #[cfg(not(feature = "git"))]
  5. pub mod git {
  6. use std::iter::FromIterator;
  7. use std::path::{Path, PathBuf};
  8. use crate::fs::fields as f;
  9. pub struct GitCache;
  10. impl FromIterator<PathBuf> for GitCache {
  11. fn from_iter<I>(_iter: I) -> Self
  12. where
  13. I: IntoIterator<Item = PathBuf>,
  14. {
  15. Self
  16. }
  17. }
  18. impl GitCache {
  19. pub fn has_anything_for(&self, _index: &Path) -> bool {
  20. false
  21. }
  22. pub fn get(&self, _index: &Path, _prefix_lookup: bool) -> f::Git {
  23. unreachable!();
  24. }
  25. }
  26. impl f::SubdirGitRepo {
  27. pub fn from_path(_dir: &Path, _status: bool) -> Self {
  28. panic!("Tried to get subdir Git status, but Git support is disabled")
  29. }
  30. }
  31. }