diff options
author | Ben S <ogham@users.noreply.github.com> | 2015-02-23 00:46:36 +0000 |
---|---|---|
committer | Ben S <ogham@users.noreply.github.com> | 2015-02-23 00:46:36 +0000 |
commit | e21dc9af2a7f35a5655cf0dd08fccaeb4a587840 (patch) | |
tree | de8605f0d5c70af0a043ab14cc64775844b8bbac /src/file.rs | |
parent | ee20c5d8bb1fdf0eae381a76218aae2e2ae78546 (diff) | |
parent | 6e19563879f5cd856ec09aa7a46c10b3e1f36b79 (diff) |
Merge pull request #21 from coyotebush/git-paths
Improve matching of Git status entries to files
Diffstat (limited to 'src/file.rs')
-rw-r--r-- | src/file.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/file.rs b/src/file.rs index 10716cd..d1cd7b8 100644 --- a/src/file.rs +++ b/src/file.rs @@ -1,6 +1,7 @@ use std::old_io::{fs, IoResult}; use std::old_io as io; use std::ascii::AsciiExt; +use std::env::current_dir; use ansi_term::{ANSIString, ANSIStrings, Colour, Style}; use ansi_term::Style::Plain; @@ -415,7 +416,8 @@ impl<'a> File<'a> { fn git_status(&self) -> Cell { let status = match self.dir { - Some(d) => d.git_status(&self.path, self.stat.kind == io::FileType::Directory), + Some(d) => d.git_status(¤t_dir().unwrap_or(Path::new(".")).join(&self.path), + self.stat.kind == io::FileType::Directory), None => GREY.paint("--").to_string(), }; |