Skip to content

Commit af7cee5

Browse files
committed
Make Repo a forward ref in Submodule.base
1 parent 33ffd0b commit af7cee5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎git/objects/submodule/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,16 @@
4747
find_first_remote_branch
4848
)
4949

50-
from git.repo import Repo
5150

5251
# typing ----------------------------------------------------------------------
53-
from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING
52+
from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING, cast
5453
from typing import Any, Iterator, Union
5554

5655
from git.types import Commit_ish, PathLike, TBD
5756

5857
if TYPE_CHECKING:
5958
from git.index import IndexFile
59+
from git.repo import Repo
6060

6161

6262
# -----------------------------------------------------------------------------
@@ -589,7 +589,7 @@ def update(self, recursive: bool = False, init: bool = True, to_latest_revision:
589589
if not dry_run:
590590
# see whether we have a valid branch to checkout
591591
try:
592-
assert isinstance(mrepo, Repo)
592+
mrepo = cast('Repo', mrepo)
593593
# find a remote which has our branch - we try to be flexible
594594
remote_branch = find_first_remote_branch(mrepo.remotes, self.branch_name)
595595
local_branch = mkhead(mrepo, self.branch_path)

0 commit comments

Comments
 (0)