2015-03-26 00:37:12 +00:00
|
|
|
// Extended attribute support
|
|
|
|
|
|
|
|
#[cfg(target_os = "macos")] mod xattr_darwin;
|
|
|
|
#[cfg(target_os = "macos")] pub use self::xattr_darwin::Attribute;
|
|
|
|
|
|
|
|
#[cfg(target_os = "linux")] mod xattr_linux;
|
|
|
|
#[cfg(target_os = "linux")] pub use self::xattr_linux::Attribute;
|
|
|
|
|
2015-06-16 23:52:06 +00:00
|
|
|
#[cfg(not(any(target_os = "macos", target_os = "linux")))] mod xattr_dummy;
|
|
|
|
#[cfg(not(any(target_os = "macos", target_os = "linux")))] pub use self::xattr_dummy::Attribute;
|
2015-03-26 00:37:12 +00:00
|
|
|
|
|
|
|
// Git support
|
|
|
|
|
|
|
|
#[cfg(feature="git")] mod git;
|
|
|
|
#[cfg(feature="git")] pub use self::git::Git;
|
|
|
|
|
|
|
|
#[cfg(not(feature="git"))] pub struct Git;
|
2015-05-24 10:05:44 +00:00
|
|
|
#[cfg(not(feature="git"))] use std::path::Path;
|
|
|
|
#[cfg(not(feature="git"))] use file::fields;
|
2015-06-08 20:33:39 +00:00
|
|
|
|
2015-03-26 00:37:12 +00:00
|
|
|
#[cfg(not(feature="git"))]
|
|
|
|
impl Git {
|
|
|
|
pub fn scan(_: &Path) -> Result<Git, ()> {
|
|
|
|
Err(())
|
|
|
|
}
|
|
|
|
|
2015-05-24 10:05:44 +00:00
|
|
|
pub fn status(&self, _: &Path) -> fields::Git {
|
2015-03-26 00:37:12 +00:00
|
|
|
panic!("Tried to access a Git repo without Git support!");
|
|
|
|
}
|
|
|
|
|
2015-05-24 10:05:44 +00:00
|
|
|
pub fn dir_status(&self, path: &Path) -> fields::Git {
|
2015-03-26 00:37:12 +00:00
|
|
|
self.status(path)
|
|
|
|
}
|
|
|
|
}
|