From 91220429984d3e0ee8fc19cdeafb89e8fe40cf53 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Sun, 2 Jun 2019 11:38:28 +1200 Subject: [PATCH] Find the repo even in a subdir --- src/git.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/git.rs b/src/git.rs index 3655285aba..4782765a23 100644 --- a/src/git.rs +++ b/src/git.rs @@ -1,7 +1,9 @@ -use git2::Repository; +use git2::{Repository, RepositoryOpenFlags}; +use std::ffi::OsString; pub fn current_branch() -> Option { - match Repository::open(".") { + let v: Vec = vec![]; + match Repository::open_ext(".", RepositoryOpenFlags::empty(), v) { Ok(repo) => { let r = repo.head(); match r {