Skip to content

Commit 8ca94fc

Browse files
committed
Merge branch 'feature/iterate-over-config-entries' into feature/return-config-entry-from-iter
2 parents 835e711 + 52de16a commit 8ca94fc

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

pygit2/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def next(self):
6363

6464
def __next__(self):
6565
entry = self._next_entry()
66-
return entry.name
66+
return entry
6767

6868

6969
class ConfigMultivarIterator(ConfigIterator):

test/test_config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ def test_iterator(self):
173173
config = self.repo.config
174174
lst = {}
175175

176-
for name in config:
177-
lst[name] = config[name]
176+
for entry in config:
177+
self.assertGreater(entry.level, -1)
178+
lst[entry.name] = entry.value_string
178179

179180
self.assertTrue('core.bare' in lst)
180181
self.assertTrue(lst['core.bare'])

0 commit comments

Comments
 (0)