|
36 | 36 |
|
37 | 37 | # typing------------------------------------------------------- |
38 | 38 |
|
39 | | -from typing import Any, Callable, Dict, Iterator, List, Optional, TYPE_CHECKING, Union, cast, overload |
| 39 | +from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, TYPE_CHECKING, Union, cast, overload |
40 | 40 |
|
41 | 41 | from git.types import PathLike, Literal, TBD |
42 | 42 |
|
@@ -277,7 +277,7 @@ def refresh(cls) -> Literal[True]: |
277 | 277 | return True |
278 | 278 |
|
279 | 279 | def __init__(self, ref: SymbolicReference, flags: int, note: str = '', |
280 | | - old_commit: Union[Commit, TagReference, Tree, Blob, None] = None, |
| 280 | + old_commit: Union['Commit', TagReference, 'Tree', 'Blob', None] = None, |
281 | 281 | remote_ref_path: Optional[PathLike] = None) -> None: |
282 | 282 | """ |
283 | 283 | Initialize a new instance |
@@ -816,12 +816,11 @@ def fetch(self, refspec: Union[str, List[str], None] = None, |
816 | 816 | if refspec is None: |
817 | 817 | # No argument refspec, then ensure the repo's config has a fetch refspec. |
818 | 818 | self._assert_refspec() |
819 | | - assert refspec is not None # for typing |
| 819 | + |
820 | 820 | kwargs = add_progress(kwargs, self.repo.git, progress) |
821 | 821 | if isinstance(refspec, list): |
822 | | - args = refspec |
| 822 | + args = refspec # type: Sequence[Optional[str]] # should need this - check logic for passing None through |
823 | 823 | else: |
824 | | - |
825 | 824 | args = [refspec] |
826 | 825 |
|
827 | 826 | proc = self.repo.git.fetch(self, *args, as_process=True, with_stdout=False, |
|
0 commit comments