mod.rs 604 字节
Newer Older
1
// Extended attribute support
B
Ben S 已提交
2
pub mod xattr;
3 4 5 6 7 8 9

// Git support

#[cfg(feature="git")] mod git;
#[cfg(feature="git")] pub use self::git::Git;

#[cfg(not(feature="git"))] pub struct Git;
10 11
#[cfg(not(feature="git"))] use std::path::Path;
#[cfg(not(feature="git"))] use file::fields;
B
Ben S 已提交
12

13 14 15 16 17 18
#[cfg(not(feature="git"))]
impl Git {
    pub fn scan(_: &Path) -> Result<Git, ()> {
        Err(())
    }

19
    pub fn status(&self, _: &Path) -> fields::Git {
20 21 22
        panic!("Tried to access a Git repo without Git support!");
    }

23
    pub fn dir_status(&self, path: &Path) -> fields::Git {
24 25 26
        self.status(path)
    }
}