File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 4646
4747# Need BaseRepository for type hints, but don't let it cause a circular dependency
4848if TYPE_CHECKING :
49- from ._libgit2 .ffi import GitRemoteC
49+ from ._libgit2 .ffi import GitRemoteC , char_pointer
5050 from .repository import BaseRepository
5151
5252
@@ -367,12 +367,12 @@ def __getitem__(self, name: str | int) -> Remote:
367367
368368 return Remote (self ._repo , cremote [0 ])
369369
370- def _ffi_names (self ):
370+ def _ffi_names (self ) -> Generator [ 'char_pointer' , None , None ] :
371371 with utils .new_git_strarray () as names :
372372 err = C .git_remote_list (names , self ._repo ._repo )
373373 check_error (err )
374374 for i in range (names .count ):
375- yield names .strings [i ]
375+ yield names .strings [i ] # type: ignore[index]
376376
377377 def names (self ) -> Generator [str | None , None , None ]:
378378 """An iterator over the names of the available remotes."""
Original file line number Diff line number Diff line change 2929from typing import (
3030 TYPE_CHECKING ,
3131 Generic ,
32+ Generator ,
3233 Iterator ,
3334 Optional ,
3435 Protocol ,
4546 from ._libgit2 .ffi import ArrayC , GitStrrayC , char , char_pointer
4647
4748
48- def maybe_string (ptr : 'char_pointer' ) -> str | None :
49+ def maybe_string (ptr : 'char_pointer' | None ) -> str | None :
4950 if not ptr :
5051 return None
5152
@@ -105,7 +106,7 @@ def ptr_to_bytes(ptr_cdata):
105106
106107
107108@contextlib .contextmanager
108- def new_git_strarray ():
109+ def new_git_strarray () -> Generator [ GitStrrayC , None , None ] :
109110 strarray = ffi .new ('git_strarray *' )
110111 yield strarray
111112 C .git_strarray_dispose (strarray )
You can’t perform that action at this time.
0 commit comments