fix: Use git2::Repository::open_ext() instead of discover() (#3591)

This lets starship respect the $GIT_CEILING_DIRECTORIES env var.
This commit is contained in:
Noa 2022-05-05 11:43:03 -05:00 committed by GitHub
parent 382445dc4d
commit 81a696a914
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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),