fix(git_config): Delta now respects env vars (fixes #1971)#2056
Open
Daniel-De-Dev wants to merge 1 commit intodandavison:mainfrom
Open
fix(git_config): Delta now respects env vars (fixes #1971)#2056Daniel-De-Dev wants to merge 1 commit intodandavison:mainfrom
Daniel-De-Dev wants to merge 1 commit intodandavison:mainfrom
Conversation
Swapping out the previous function `git2::Repository::discover()` with the function `git2::Repository::open_from_env()` fixes the problem and actually respects the enviroment variables `GIT_CONFIG_SYSTEM` & `GIT_CONFIG_GLOBAL`
Author
|
I went and attempted in testing OP's original problem and it seems to work on the unpatched version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change replaces
git2::Repository::discover()withgit2::Repository::open_from_env(), which seems to correctly respect theGIT_CONFIG_SYSTEMandGIT_CONFIG_GLOBALenvironment variables. (and by extenstion OP's problem? havent checked)I haven’t done extensive testing, but this change resolves the issue I was seeing. As far as I can tell, the core behavior is preserved, but I trust that a reviewer with more experience would be able to confirm.