Skip to content

Commit 84e256d

Browse files
committed
Describe Submodule.__init__ parent_commit parameter
This includes a brief description of the Submodule.__init__ parent_commit parameter in its docstring, rather than only referring to the set_parent_commit method, whose semantics differ due to conversation and validation, and which accepts more types than just Commit or None. The wording is based on wording in set_parent_commit, adjusted for the difference in types, and set_parent_commit remains reference for further details. This builds on 1f03e7f (gitpython-developers#1859) in improving the situation described in gitpython-developers#1869.
1 parent bcea9a8 commit 84e256d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

git/objects/submodule/base.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,9 @@ def __init__(
143143
See the `url` parameter.
144144
145145
:param parent_commit:
146-
See :meth:`set_parent_commit`.
146+
The :class:`~git.objects.commit.Commit` whose tree is supposed to contain
147+
the ``.gitmodules`` blob, or ``None`` to always point to the most recent
148+
commit. See :meth:`set_parent_commit` for details.
147149
148150
:param url:
149151
The URL to the remote repository which is the submodule.
@@ -1260,7 +1262,7 @@ def set_parent_commit(self, commit: Union[Commit_ish, str, None], check: bool =
12601262
contain the ``.gitmodules`` blob.
12611263
12621264
:param commit:
1263-
Commit-ish reference pointing at the root_tree, or ``None`` to always point
1265+
Commit-ish reference pointing at the root tree, or ``None`` to always point
12641266
to the most recent commit.
12651267
12661268
:param check:

0 commit comments

Comments
 (0)