From 81a696a914f6761d42b69f139018c3fa663ff197 Mon Sep 17 00:00:00 2001 From: Noa Date: Thu, 5 May 2022 11:43:03 -0500 Subject: [PATCH] fix: Use git2::Repository::open_ext() instead of discover() (#3591) This lets starship respect the $GIT_CEILING_DIRECTORIES env var. --- src/context.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/context.rs b/src/context.rs index 8c95ec68..c837d635 100644 --- a/src/context.rs +++ b/src/context.rs @@ -260,7 +260,8 @@ impl<'a> Context<'a> { let repository = if env::var("GIT_DIR").is_ok() { Repository::open_from_env() } else { - Repository::discover(&self.current_dir) + let dirs: [PathBuf; 0] = []; + Repository::open_ext(&self.current_dir, git2::RepositoryOpenFlags::FROM_ENV, dirs) }?; Ok(Repo { branch: get_current_branch(&repository),