Skip to content

Closes #1466: Fix error when snapshotting non-repo config, and improve config documentation#1468

Open
beamerblvd wants to merge 1 commit into
libgit2:masterfrom
beamerblvd:fix-global-config-snapshot
Open

Closes #1466: Fix error when snapshotting non-repo config, and improve config documentation#1468
beamerblvd wants to merge 1 commit into
libgit2:masterfrom
beamerblvd:fix-global-config-snapshot

Conversation

@beamerblvd

Copy link
Copy Markdown
Contributor
  • Most of this change is actually documentation improvement for the Config class and some of its methods.
  • Calling Config.snapshot() previously raised an AttributeError if the Config did not come from a repository (i.e. the system or global config or a config loaded from a file). This is fixed by ensuring that self._repo is always set to something (None by default).
  • Passing a PathLike into Config.__init__() resulted in a TypeError unnecessarily. This is supported now.
  • Added tests that confirm this behavior.
  • Updated the test_global_config and test_system_config tests so that they emit a skip message if they can't run due to a non-existent file (also created Pytest tests cannot load global config that definitely exists even though real use of the library can #1467 about a weird problem with these tests that I can't figure out).

- Most of this change is documentation improvement for the `Config`
  class and some of its methods.
- Calling `Config.snapshot()` previously raised an attribute error if
  the `Config` did not come from a repository (i.e. the system or global
config or a config loaded from a file). This is fixed by ensuring that
`self._repo` is always set to something (`None` by default).
- Passing a `PathLike` into `Config.__init__()` resulted in a value
  error unneccesarily. This is supported now.
- Added tests that confirm this behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant