GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Keep the type of a Commit's `parents` from being too narrow · gitpython-developers/GitPython@e66297a

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • git/objects
    • commit.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎git/objects/commit.py‎

Copy file name to clipboardExpand all lines: git/objects/commit.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class Commit(base.Object, TraversableIterableObj, Diffable, Serializable):
7979
# INVARIANTS
8080
default_encoding = "UTF-8"
8181

82-
# object configuration
8382
type: Literal["commit"] = "commit"
83+
8484
__slots__ = (
8585
"tree",
8686
"author",
@@ -94,8 +94,11 @@ class Commit(base.Object, TraversableIterableObj, Diffable, Serializable):
9494
"encoding",
9595
"gpgsig",
9696
)
97+
9798
_id_attribute_ = "hexsha"
9899

100+
parents: Sequence["Commit"]
101+
99102
def __init__(
100103
self,
101104
repo: "Repo",
@@ -753,7 +756,7 @@ def _deserialize(self, stream: BytesIO) -> "Commit":
753756
readline = stream.readline
754757
self.tree = Tree(self.repo, hex_to_bin(readline().split()[1]), Tree.tree_id << 12, "")
755758

756-
self.parents = [] # type: List[Commit]
759+
self.parents = []
757760
next_line = None
758761
while True:
759762
parent_line = readline()

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.