From c8c9e7480c6c3f05a62d84d3aae4da32e32c0489 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 27 Feb 2018 02:57:13 -0500 Subject: open_from_env is a cleaner api here --- src/vcs/git.rs | 7 +------ 1 file changed, 1 insertion(+), 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> { 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!(); -- cgit v1.2.3