aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2018-02-27 02:57:13 -0500
committerJesse Luehrs <doy@tozt.net>2018-02-27 03:03:11 -0500
commitc8c9e7480c6c3f05a62d84d3aae4da32e32c0489 (patch)
tree611eaeecee222aace3ceee053f140a640b4fc301
parentaa45fae4852080b7f7289408248499b3cecc8169 (diff)
downloadfancy-prompt-c8c9e7480c6c3f05a62d84d3aae4da32e32c0489.tar.gz
fancy-prompt-c8c9e7480c6c3f05a62d84d3aae4da32e32c0489.zip
open_from_env is a cleaner api here
-rw-r--r--src/vcs/git.rs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/vcs/git.rs b/src/vcs/git.rs
index 74696ec..c745c46 100644
--- a/src/vcs/git.rs
+++ b/src/vcs/git.rs
@@ -1,5 +1,4 @@
use git2;
-use std;
use std::fmt::Write;
@@ -189,11 +188,7 @@ impl super::VcsInfo for GitInfo {
pub fn detect() -> Option<Box<super::VcsInfo>> {
start_talking_about_time!("git::detect");
- let pwd = std::env::current_dir();
- talk_about_time!("pwd");
- let git = pwd
- .ok()
- .and_then(|pwd| git2::Repository::discover(pwd).ok());
+ let git = git2::Repository::open_from_env().ok();
talk_about_time!("discover");
stop_talking_about_time!();