Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix get_values() so it correctly loads section names #1555

Merged
merged 2 commits into from Feb 16, 2023
Merged

Fix get_values() so it correctly loads section names #1555

merged 2 commits into from Feb 16, 2023

Conversation

Codym48
Copy link
Contributor

@Codym48 Codym48 commented Feb 16, 2023

As described in #1534, some calls to GitConfigParser().get_values() fail in main with a KeyError about a missing section name even though the named sections do exist within the config file.

Add a test that calls get_values() before anything else to catch this failure. Update the get_values() function to work, even if it's the first call after creating the GitConfigParser, by eagerly load the section names before trying to access them. This passes the new test.

kfreezen and others added 2 commits January 10, 2023 11:17
As described in #1534, this test will fail in main with a KeyError
about a missing section name even though the named sections do exist
within the config file.

This test will pass in the branch associated with #1535. This test
should keep the improved behavior healthy as the code evolves by
preventing future developers from removing the eager loading of
sections within get_values().
@Byron
Copy link
Member

Byron commented Feb 16, 2023

Thanks a lot for your help!

@Byron Byron merged commit 0e5358a into gitpython-developers:main Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants