Skip to content

'user' section of config exists for sections() but not items methods #1711

Open
@pushfoo

Description

@pushfoo

This appears to work fine:

>>> reader = repo_instance.config_reader()
>>> reader.sections()
['filter "lfs"', 'core', 'user']

However, these do not:

>>> reader.items('user')
NoSectionError: "No section: 'user'"

>>> reader.items_all('user')
KeyError: 'user'

I've confirmed the section exists in the repo's local .git/config as follows:

[user]
        name = pushfoo
        email = 36696816+pushfoo@users.noreply.github.com

If this is due to misuse on my part, please let me know how. I'd be willing to try to make a PR to do the following:

  1. Make the exceptions more consistent
  2. Update relevant doc to be clearer
  3. Fix underlying bugs

Depending on how far down into git's internals I need to go, the last option may require some guidance from project leads.

EDIT: Version info:

Detail Value Comments
Python Version 3.9.2 Stock for Debian 11
Git version 2.30.2 Stock for Debian 11
OS / version Debian 11 No major customization have been applied
GitPthon version 3.1.37 default for pip install
gitdb version 4.0.10 default installed by above

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions