diff options
-rw-r--r-- | git/objects/submodule/base.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index 401ef54e..2ace1f03 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -47,15 +47,15 @@ from .util import ( find_first_remote_branch ) -from git.repo import Repo # typing ---------------------------------------------------------------------- -from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING +from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING, cast from typing import Any, Iterator, Union from git.types import Commit_ish, PathLike, TBD if TYPE_CHECKING: + from git.repo import Repo from git.index import IndexFile @@ -589,7 +589,8 @@ class Submodule(IndexObject, TraversableIterableObj): if not dry_run: # see whether we have a valid branch to checkout try: - assert isinstance(mrepo, Repo) + # assert isinstance(mrepo, Repo) # cant do this cos of circular import + mrepo = cast('Repo', mrepo) # Try TypeGuard wirh hasattr? # find a remote which has our branch - we try to be flexible remote_branch = find_first_remote_branch(mrepo.remotes, self.branch_name) local_branch = mkhead(mrepo, self.branch_path) |