Skip to content

Commit 06eca0b

Browse files
committed
Make subodule a forward ref in Index.base
1 parent 94c2ae4 commit 06eca0b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎git/index/base.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
)
2323
from git.objects import (
2424
Blob,
25-
Submodule,
2625
Tree,
2726
Object,
2827
Commit,
@@ -76,6 +75,7 @@
7675
from git.repo import Repo
7776
from git.refs.reference import Reference
7877
from git.util import Actor
78+
from git.objects.submodule.base import Submodule
7979

8080

8181
StageType = int
@@ -842,7 +842,7 @@ def _items_to_rela_paths(self, items):
842842
items = [items]
843843

844844
for item in items:
845-
if isinstance(item, (BaseIndexEntry, (Blob, Submodule))):
845+
if isinstance(item, (BaseIndexEntry, (Blob, 'Submodule'))):
846846
paths.append(self._to_relative_path(item.path))
847847
elif isinstance(item, str):
848848
paths.append(self._to_relative_path(item))
@@ -853,7 +853,7 @@ def _items_to_rela_paths(self, items):
853853

854854
@post_clear_cache
855855
@default_index
856-
def remove(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, Submodule]], working_tree: bool = False,
856+
def remove(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, 'Submodule']], working_tree: bool = False,
857857
**kwargs: Any) -> List[str]:
858858
"""Remove the given items from the index and optionally from
859859
the working tree as well.
@@ -905,7 +905,7 @@ def remove(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, Submodule
905905

906906
@post_clear_cache
907907
@default_index
908-
def move(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, Submodule]], skip_errors: bool = False,
908+
def move(self, items: Sequence[Union[PathLike, Blob, BaseIndexEntry, 'Submodule']], skip_errors: bool = False,
909909
**kwargs: Any) -> List[Tuple[str, str]]:
910910
"""Rename/move the items, whereas the last item is considered the destination of
911911
the move operation. If the destination is a file, the first item ( of two )

0 commit comments

Comments
 (0)