summaryrefslogtreecommitdiffstats
path: root/src/dir.rs
diff options
context:
space:
mode:
authorBen S <ogham@bsago.me>2015-05-11 23:28:01 +0100
committerBen S <ogham@bsago.me>2015-05-11 23:28:01 +0100
commitdc6599b1b344370b851b9e9ca32ef62ba7d9a1c8 (patch)
tree47f1277d34621b1e93f38d4e487ed6ad92f9540e /src/dir.rs
parentbc844a3843cdc56630cf87c8f3ba1f2d6aa4152f (diff)
Turn File into simply a data source
And move all the rendering, ansi_term, colourful stuff into the output modules, which is the only place they should be used!
Diffstat (limited to 'src/dir.rs')
-rw-r--r--src/dir.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/dir.rs b/src/dir.rs
index 9433829..438bef7 100644
--- a/src/dir.rs
+++ b/src/dir.rs
@@ -1,6 +1,7 @@
use colours::Colours;
use feature::Git;
use file::File;
+use file;
use std::io;
use std::fs;
@@ -65,11 +66,11 @@ impl Dir {
}
/// Get a string describing the Git status of the given file.
- pub fn git_status(&self, path: &Path, colours: &Colours, prefix_lookup: bool) -> String {
+ pub fn git_status(&self, path: &Path, prefix_lookup: bool) -> file::Git {
match (&self.git, prefix_lookup) {
- (&Some(ref git), false) => git.status(colours, path),
- (&Some(ref git), true) => git.dir_status(colours, path),
- (&None, _) => colours.punctuation.paint("--").to_string(),
+ (&Some(ref git), false) => git.status(path),
+ (&Some(ref git), true) => git.dir_status(path),
+ (&None, _) => file::Git::empty()
}
}
}