supply libgit2 with flag to respect env variables (#2299)

closes #2298
This commit is contained in:
extrawurst 2024-07-25 11:16:01 +07:00 committed by GitHub
parent 7fec560942
commit ce923e6fe4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 6 additions and 3 deletions

View File

@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Fixes
* respect env vars like `GIT_CONFIG_GLOBAL` ([#2298](https://github.com/extrawurst/gitui/issues/2298))
## [0.26.3] - 2024-06-02
### Breaking Changes

View File

@ -51,7 +51,7 @@ impl From<&str> for RepoPath {
pub fn repo(repo_path: &RepoPath) -> Result<Repository> {
let repo = Repository::open_ext(
repo_path.gitpath(),
RepositoryOpenFlags::empty(),
RepositoryOpenFlags::FROM_ENV,
Vec::<&Path>::new(),
)?;

View File

@ -123,7 +123,7 @@ pub fn submodule_parent_info(
if let Ok(parent) = Repository::open_ext(
parent_path,
RepositoryOpenFlags::empty(),
RepositoryOpenFlags::FROM_ENV,
Vec::<&Path>::new(),
) {
let parent_wd = work_dir(&parent)?.to_path_buf();

View File

@ -28,7 +28,7 @@ pub struct Head {
pub fn repo_open_error(repo_path: &RepoPath) -> Option<String> {
Repository::open_ext(
repo_path.gitpath(),
RepositoryOpenFlags::empty(),
RepositoryOpenFlags::FROM_ENV,
Vec::<&Path>::new(),
)
.map_or_else(|e| Some(e.to_string()), |_| None)