FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Help tools know the type of a Commit's `parents` · gitpython-developers/GitPython@fe42ca7 · GitHub

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

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎git/objects/commit.py‎

Lines changed: 1 addition & 1 deletion
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)

Back | FazBrowse Home | New Git URL