From af7cee514632a4a3825dbb5655a208d2ebd1f67f Mon Sep 17 00:00:00 2001 From: Yobmod Date: Tue, 6 Jul 2021 16:57:12 +0100 Subject: Make Repo a forward ref in Submodule.base --- git/objects/submodule/base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'git/objects/submodule') diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index 87a86749..847b4325 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -47,16 +47,16 @@ 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.index import IndexFile + from git.repo import Repo # ----------------------------------------------------------------------------- @@ -589,7 +589,7 @@ class Submodule(IndexObject, TraversableIterableObj): if not dry_run: # see whether we have a valid branch to checkout try: - assert isinstance(mrepo, Repo) + mrepo = cast('Repo', mrepo) # 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) -- cgit v1.2.1