Skip to content

Commit fe42ca7

Browse files
committed
Help tools know the type of a Commit's parents
mypy seems not to need this, and already infers the specific type List[Commit], but some other type checkers -- at least pylance, and thus probably also pyright -- do not infer this.
1 parent d1ce940 commit fe42ca7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git/objects/commit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ def _deserialize(self, stream: BytesIO) -> "Commit":
753753
readline = stream.readline
754754
self.tree = Tree(self.repo, hex_to_bin(readline().split()[1]), Tree.tree_id << 12, "")
755755

756-
self.parents = []
756+
self.parents = [] # type: List[Commit]
757757
next_line = None
758758
while True:
759759
parent_line = readline()

0 commit comments

Comments
 (0)