mod.rs 604 B

1234567891011121314151617181920212223242526
  1. // Extended attribute support
  2. pub mod xattr;
  3. // Git support
  4. #[cfg(feature="git")] mod git;
  5. #[cfg(feature="git")] pub use self::git::Git;
  6. #[cfg(not(feature="git"))] pub struct Git;
  7. #[cfg(not(feature="git"))] use std::path::Path;
  8. #[cfg(not(feature="git"))] use file::fields;
  9. #[cfg(not(feature="git"))]
  10. impl Git {
  11. pub fn scan(_: &Path) -> Result<Git, ()> {
  12. Err(())
  13. }
  14. pub fn status(&self, _: &Path) -> fields::Git {
  15. panic!("Tried to access a Git repo without Git support!");
  16. }
  17. pub fn dir_status(&self, path: &Path) -> fields::Git {
  18. self.status(path)
  19. }
  20. }