diff options
author | Yobmod <yobmod@gmail.com> | 2021-07-24 22:05:06 +0100 |
---|---|---|
committer | Yobmod <yobmod@gmail.com> | 2021-07-24 22:05:06 +0100 |
commit | d812818cb20c39e0bb5609186214ea4bcc18c047 (patch) | |
tree | 59caeb4d7a9d0ee97553ce09ad5c19e85d76134d /git/objects/submodule/base.py | |
parent | 2bc2ac02e270404fcb609eeacc4feea6146b9d2e (diff) | |
download | gitpython-d812818cb20c39e0bb5609186214ea4bcc18c047.tar.gz |
Rmv with_metaclass shim, make section constraint generic wrt its configparser type
Diffstat (limited to 'git/objects/submodule/base.py')
-rw-r--r-- | git/objects/submodule/base.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index d5ba118f..29212167 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -965,13 +965,12 @@ class Submodule(IndexObject, TraversableIterableObj): # now git config - need the config intact, otherwise we can't query # information anymore - writer: Union[GitConfigParser, SectionConstraint] - with self.repo.config_writer() as writer: - writer.remove_section(sm_section(self.name)) + with self.repo.config_writer() as gcp_writer: + gcp_writer.remove_section(sm_section(self.name)) - with self.config_writer() as writer: - writer.remove_section() + with self.config_writer() as sc_writer: + sc_writer.remove_section() # END delete configuration return self @@ -1024,7 +1023,8 @@ class Submodule(IndexObject, TraversableIterableObj): return self @unbare_repo - def config_writer(self, index: Union['IndexFile', None] = None, write: bool = True) -> SectionConstraint: + def config_writer(self, index: Union['IndexFile', None] = None, write: bool = True + ) -> SectionConstraint['SubmoduleConfigParser']: """:return: a config writer instance allowing you to read and write the data belonging to this submodule into the .gitmodules file. @@ -1201,7 +1201,7 @@ class Submodule(IndexObject, TraversableIterableObj): """ return self._name - def config_reader(self) -> SectionConstraint: + def config_reader(self) -> SectionConstraint[SubmoduleConfigParser]: """ :return: ConfigReader instance which allows you to qurey the configuration values of this submodule, as provided by the .gitmodules file |