MCPcopy Create free account
hub / github.com/libgit2/pygit2 / __iter__

Method __iter__

pygit2/remotes.py:417–423  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

415 return names.count
416
417 def __iter__(self) -> Iterator[Remote]:
418 cremote = ffi.new('git_remote **')
419 for name in self._ffi_names():
420 err = C.git_remote_lookup(cremote, self._repo._repo, name)
421 check_error(err)
422
423 yield Remote(self._repo, cremote[0])
424
425 def __getitem__(self, name: str | int) -> Remote:
426 if isinstance(name, int):

Callers

nothing calls this directly

Calls 3

_ffi_namesMethod · 0.95
check_errorFunction · 0.85
RemoteClass · 0.85

Tested by

no test coverage detected