summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-06 16:57:12 +0100
committerYobmod <yobmod@gmail.com>2021-07-06 16:57:12 +0100
commitaf7cee514632a4a3825dbb5655a208d2ebd1f67f (patch)
tree1eee211dacd30cefa080c3a5e6fb7ae3d4d59fef
parent33ffd0b2ed117d043fe828e5f2eabe5c8f8b0b66 (diff)
downloadgitpython-af7cee514632a4a3825dbb5655a208d2ebd1f67f.tar.gz
Make Repo a forward ref in Submodule.base
-rw-r--r--git/objects/submodule/base.py6
1 files changed, 3 insertions, 3 deletions
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)