diff options
Diffstat (limited to 'git/remote.py')
-rw-r--r-- | git/remote.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/git/remote.py b/git/remote.py index d903552f..11007cb6 100644 --- a/git/remote.py +++ b/git/remote.py @@ -23,6 +23,7 @@ from git.util import ( ) from .config import ( + GitConfigParser, SectionConstraint, cp, ) @@ -37,9 +38,9 @@ from .refs import ( # typing------------------------------------------------------- from typing import (Any, Callable, Dict, Iterator, List, NoReturn, Optional, Sequence, # NOQA[TC002] - TYPE_CHECKING, Type, Union, overload) + TYPE_CHECKING, Type, Union, cast, overload) -from git.types import PathLike, Literal, TBD, TypeGuard, Commit_ish # NOQA[TC002] +from git.types import PathLike, Literal, TBD, Commit_ish # NOQA[TC002] if TYPE_CHECKING: from git.repo.base import Repo @@ -50,8 +51,8 @@ if TYPE_CHECKING: flagKeyLiteral = Literal[' ', '!', '+', '-', '*', '=', 't', '?'] -def is_flagKeyLiteral(inp: str) -> TypeGuard[flagKeyLiteral]: - return inp in [' ', '!', '+', '-', '=', '*', 't', '?'] +# def is_flagKeyLiteral(inp: str) -> TypeGuard[flagKeyLiteral]: +# return inp in [' ', '!', '+', '-', '=', '*', 't', '?'] # ------------------------------------------------------------- @@ -342,8 +343,8 @@ class FetchInfo(IterableObj, object): # parse lines remote_local_ref_str: str control_character, operation, local_remote_ref, remote_local_ref_str, note = match.groups() - assert is_flagKeyLiteral(control_character), f"{control_character}" - + # assert is_flagKeyLiteral(control_character), f"{control_character}" + control_character = cast(flagKeyLiteral, control_character) try: _new_hex_sha, _fetch_operation, fetch_note = fetch_line.split("\t") ref_type_name, fetch_note = fetch_note.split(' ', 1) @@ -911,7 +912,7 @@ class Remote(LazyMixin, IterableObj): return self._get_push_info(proc, progress) @ property - def config_reader(self) -> SectionConstraint: + def config_reader(self) -> SectionConstraint[GitConfigParser]: """ :return: GitConfigParser compatible object able to read options for only our remote. |