diff options
author | Shawn O. Pearce <sop@google.com> | 2009-05-19 12:47:37 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2009-05-19 13:02:00 -0700 |
commit | 366ad214b82cadc32920b371f7f99f3f6894ec6f (patch) | |
tree | c77245ffbd172a5f3a6cc6c41dbe14eb4140e9d5 | |
parent | 242b52690d327a77e47140509085f406155c5722 (diff) | |
download | git-repo-366ad214b82cadc32920b371f7f99f3f6894ec6f.tar.gz |
Teach GitConfig how to yield subsection names
This can be useful when pulling apart a configuration file, like
finding all entries which match submodule.*.*.
Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r-- | git_config.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/git_config.py b/git_config.py index 6ea505f9..bc7ed459 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -172,6 +172,11 @@ class GitConfig(object): | |||
172 | self._branches[b.name] = b | 172 | self._branches[b.name] = b |
173 | return b | 173 | return b |
174 | 174 | ||
175 | def GetSubSections(self, section): | ||
176 | """List all subsection names matching $section.*.* | ||
177 | """ | ||
178 | return self._sections.get(section, set()) | ||
179 | |||
175 | def HasSection(self, section, subsection = ''): | 180 | def HasSection(self, section, subsection = ''): |
176 | """Does at least one key in section.subsection exist? | 181 | """Does at least one key in section.subsection exist? |
177 | """ | 182 | """ |