Use Repository::discover instead of open_from_env

This commit is contained in:
Tad Hardesty 2018-03-17 21:29:28 -07:00
parent 32ae1b539b
commit 5f1f2dc554

View file

@ -17,7 +17,7 @@ fn main() {
}
fn read_commit() -> Result<String, git2::Error> {
let repo = git2::Repository::open_from_env()?;
let repo = git2::Repository::discover(".")?;
let hash = repo.head()?.peel_to_commit()?.id().to_string();
Ok(hash)
}