|
45 | 45 | from typing import Callable, Dict, Mapping, Sequence, TYPE_CHECKING, cast
|
46 | 46 | from typing import Any, Iterator, Union
|
47 | 47 |
|
48 |
| -from git.types import Old_commit_ish, Literal, PathLike, TBD |
| 48 | +from git.types import Commit_ish, Literal, Old_commit_ish, PathLike, TBD |
49 | 49 |
|
50 | 50 | if TYPE_CHECKING:
|
51 | 51 | from git.index import IndexFile
|
52 |
| - from git.repo import Repo |
| 52 | + from git.objects.commit import Commit |
53 | 53 | from git.refs import Head
|
| 54 | + from git.repo import Repo |
54 | 55 |
|
55 | 56 | # -----------------------------------------------------------------------------
|
56 | 57 |
|
@@ -99,7 +100,7 @@ class Submodule(IndexObject, TraversableIterableObj):
|
99 | 100 | """Submodule flags. Submodules are directories with link-status."""
|
100 | 101 |
|
101 | 102 | type: Literal["submodule"] = "submodule" # type: ignore
|
102 |
| - """This is a bogus type for base class compatibility.""" |
| 103 | + """This is a bogus type string for base class compatibility.""" |
103 | 104 |
|
104 | 105 | __slots__ = ("_parent_commit", "_url", "_branch_path", "_name", "__weakref__")
|
105 | 106 |
|
@@ -1242,7 +1243,7 @@ def remove(
|
1242 | 1243 |
|
1243 | 1244 | return self
|
1244 | 1245 |
|
1245 |
| - def set_parent_commit(self, commit: Union[Old_commit_ish, None], check: bool = True) -> "Submodule": |
| 1246 | + def set_parent_commit(self, commit: Union[Commit_ish, str, None], check: bool = True) -> "Submodule": |
1246 | 1247 | """Set this instance to use the given commit whose tree is supposed to
|
1247 | 1248 | contain the ``.gitmodules`` blob.
|
1248 | 1249 |
|
@@ -1495,7 +1496,7 @@ def url(self) -> str:
|
1495 | 1496 | return self._url
|
1496 | 1497 |
|
1497 | 1498 | @property
|
1498 |
| - def parent_commit(self) -> "Old_commit_ish": |
| 1499 | + def parent_commit(self) -> "Commit": |
1499 | 1500 | """
|
1500 | 1501 | :return:
|
1501 | 1502 | :class:`~git.objects.commit.Commit` instance with the tree containing the
|
@@ -1557,8 +1558,8 @@ def children(self) -> IterableList["Submodule"]:
|
1557 | 1558 | def iter_items(
|
1558 | 1559 | cls,
|
1559 | 1560 | repo: "Repo",
|
1560 |
| - parent_commit: Union[Old_commit_ish, str] = "HEAD", |
1561 |
| - *Args: Any, |
| 1561 | + parent_commit: Union[Commit_ish, str] = "HEAD", |
| 1562 | + *args: Any, |
1562 | 1563 | **kwargs: Any,
|
1563 | 1564 | ) -> Iterator["Submodule"]:
|
1564 | 1565 | """
|
|
0 commit comments